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

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.cjs CHANGED
@@ -21462,8 +21462,9 @@ class Strapi {
21462
21462
  }
21463
21463
  async can(uid, controller, action) {
21464
21464
  if (!this.permissionsList) {
21465
- const response = await this.fetchData('users-permissions/permissions');
21466
- this.permissionsList = response.permissions;
21465
+ const { role } = await this.me();
21466
+ const response = await this.fetchData(`users-permissions/role/${role?.documentId}`);
21467
+ this.permissionsList = response.role.permissions;
21467
21468
  }
21468
21469
  if (!this.permissionsList[uid]) {
21469
21470
  throw new Error(`Permissions for ${uid} not found!`);