@malevich-studio/strapi-sdk-typescript 1.2.18 → 1.2.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.mjs CHANGED
@@ -21442,8 +21442,9 @@ class Strapi {
21442
21442
  }
21443
21443
  async can(uid, controller, action) {
21444
21444
  if (!this.permissionsList) {
21445
- const response = await this.fetchData('users-permissions/permissions');
21446
- this.permissionsList = response.permissions;
21445
+ const { role } = await this.me({ populate: { role: { fields: ["id"] } } });
21446
+ const response = await this.fetchData(`users-permissions/roles/${role?.id}`);
21447
+ this.permissionsList = response.role.permissions;
21447
21448
  }
21448
21449
  if (!this.permissionsList[uid]) {
21449
21450
  throw new Error(`Permissions for ${uid} not found!`);