@devstroupe/devkit-cli 1.1.3 → 1.1.4
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.
|
@@ -113,4 +113,17 @@ export class AuthService {
|
|
|
113
113
|
|
|
114
114
|
return Array.isArray(permissions) && permissions.includes(permission);
|
|
115
115
|
}
|
|
116
|
+
|
|
117
|
+
hasRole(role: string): boolean {
|
|
118
|
+
const user = this.currentUser;
|
|
119
|
+
if (!user) return false;
|
|
120
|
+
|
|
121
|
+
const roleName = typeof user.role === 'object' ? (user.role as any).name : user.role;
|
|
122
|
+
|
|
123
|
+
if (roleName === 'ADMIN' || roleName === 'Administrador') {
|
|
124
|
+
return true;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
return roleName === role;
|
|
128
|
+
}
|
|
116
129
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devstroupe/devkit-cli",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.4",
|
|
4
4
|
"description": "DevsTroupe Development Kit CLI — scaffold NestJS+Angular projects, inject Spartan UI, generate CRUDs and audit architectural governance",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"commander": "^12.0.0",
|
|
38
38
|
"fs-extra": "^11.2.0",
|
|
39
|
-
"@devstroupe/devkit-core": "1.1.
|
|
39
|
+
"@devstroupe/devkit-core": "1.1.4"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@types/fs-extra": "^11.0.4",
|