@malevich-studio/strapi-sdk-typescript 1.2.19 → 1.2.21
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 +10 -6
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.mjs +10 -6
- package/dist/cli.mjs.map +1 -1
- package/dist/index.cjs +5 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +16 -9
- package/dist/index.mjs +5 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -21438,8 +21438,11 @@ class Strapi {
|
|
|
21438
21438
|
}
|
|
21439
21439
|
async can(uid, controller, action) {
|
|
21440
21440
|
if (!this.permissionsList) {
|
|
21441
|
-
const
|
|
21442
|
-
|
|
21441
|
+
const user = await this.baseMe({ populate: { role: { fields: ["id"] } } });
|
|
21442
|
+
if (user.error) {
|
|
21443
|
+
return false;
|
|
21444
|
+
}
|
|
21445
|
+
const response = await this.fetchData(`users-permissions/roles/${user.role.id}`);
|
|
21443
21446
|
this.permissionsList = response.role.permissions;
|
|
21444
21447
|
}
|
|
21445
21448
|
if (!this.permissionsList[uid]) {
|