authscape 1.0.582 → 1.0.584
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/index.js +11 -0
- package/package.json +1 -1
- package/src/components/AuthScapeApp.js +15 -0
package/index.js
CHANGED
|
@@ -364,6 +364,17 @@ function AuthScapeApp(_ref) {
|
|
|
364
364
|
}
|
|
365
365
|
}
|
|
366
366
|
};
|
|
367
|
+
_signedInUser.hasRoleId = function (id) {
|
|
368
|
+
if (_signedInUser.roles != null) {
|
|
369
|
+
if (_signedInUser.roles.find(function (r) {
|
|
370
|
+
return r.id === id;
|
|
371
|
+
}) != null) {
|
|
372
|
+
return true;
|
|
373
|
+
} else {
|
|
374
|
+
return false;
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
};
|
|
367
378
|
_signedInUser.hasPermission = function (name) {
|
|
368
379
|
if (_signedInUser.permissions != null) {
|
|
369
380
|
if (_signedInUser.permissions.find(function (r) {
|
package/package.json
CHANGED
|
@@ -358,6 +358,21 @@ export function AuthScapeApp ({Component, layout, loadingLayout, pageProps, muiT
|
|
|
358
358
|
}
|
|
359
359
|
};
|
|
360
360
|
|
|
361
|
+
_signedInUser.hasRoleId = function(id) {
|
|
362
|
+
|
|
363
|
+
if (_signedInUser.roles != null)
|
|
364
|
+
{
|
|
365
|
+
if (_signedInUser.roles.find(r => r.id === id) != null)
|
|
366
|
+
{
|
|
367
|
+
return true;
|
|
368
|
+
}
|
|
369
|
+
else
|
|
370
|
+
{
|
|
371
|
+
return false;
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
};
|
|
375
|
+
|
|
361
376
|
_signedInUser.hasPermission = function(name) {
|
|
362
377
|
|
|
363
378
|
if (_signedInUser.permissions != null)
|