authscape 1.0.568 → 1.0.570
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 +4 -4
- package/package.json +1 -1
- package/src/components/AuthScapeApp.js +4 -4
package/index.js
CHANGED
|
@@ -354,8 +354,8 @@ function AuthScapeApp(_ref) {
|
|
|
354
354
|
var _signedInUser = signedInUser.current;
|
|
355
355
|
if (_signedInUser != null) {
|
|
356
356
|
_signedInUser.HasRole = function (name) {
|
|
357
|
-
if (
|
|
358
|
-
if (
|
|
357
|
+
if (_signedInUser.roles != null) {
|
|
358
|
+
if (_signedInUser.roles.find(function (r) {
|
|
359
359
|
return r.name === name;
|
|
360
360
|
}) != null) {
|
|
361
361
|
return true;
|
|
@@ -365,8 +365,8 @@ function AuthScapeApp(_ref) {
|
|
|
365
365
|
}
|
|
366
366
|
};
|
|
367
367
|
_signedInUser.HasPermission = function (name) {
|
|
368
|
-
if (
|
|
369
|
-
if (
|
|
368
|
+
if (_signedInUser.permissions != null) {
|
|
369
|
+
if (_signedInUser.permissions.find(function (r) {
|
|
370
370
|
return r === name;
|
|
371
371
|
}) != null) {
|
|
372
372
|
return true;
|
package/package.json
CHANGED
|
@@ -345,9 +345,9 @@ export function AuthScapeApp ({Component, layout, loadingLayout, pageProps, muiT
|
|
|
345
345
|
{
|
|
346
346
|
_signedInUser.HasRole = function(name) {
|
|
347
347
|
|
|
348
|
-
if (
|
|
348
|
+
if (_signedInUser.roles != null)
|
|
349
349
|
{
|
|
350
|
-
if (
|
|
350
|
+
if (_signedInUser.roles.find(r => r.name === name) != null)
|
|
351
351
|
{
|
|
352
352
|
return true;
|
|
353
353
|
}
|
|
@@ -360,9 +360,9 @@ export function AuthScapeApp ({Component, layout, loadingLayout, pageProps, muiT
|
|
|
360
360
|
|
|
361
361
|
_signedInUser.HasPermission = function(name) {
|
|
362
362
|
|
|
363
|
-
if (
|
|
363
|
+
if (_signedInUser.permissions != null)
|
|
364
364
|
{
|
|
365
|
-
if (
|
|
365
|
+
if (_signedInUser.permissions.find(r => r === name) != null)
|
|
366
366
|
{
|
|
367
367
|
return true;
|
|
368
368
|
}
|