authscape 1.0.562 → 1.0.564
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 +5 -8
- package/package.json +1 -1
- package/src/components/AuthScapeApp.js +5 -7
package/index.js
CHANGED
|
@@ -350,11 +350,8 @@ function AuthScapeApp(_ref) {
|
|
|
350
350
|
}
|
|
351
351
|
};
|
|
352
352
|
var GetSignedInUser = function GetSignedInUser() {
|
|
353
|
-
var
|
|
354
|
-
|
|
355
|
-
// create the prototype for reading role and permission
|
|
356
|
-
|
|
357
|
-
_signedInUser.HasRole = function (name) {
|
|
353
|
+
var signedInUser = signedInUser.current;
|
|
354
|
+
signedInUser.HasRole = function (name) {
|
|
358
355
|
if (currentUser.roles.find(function (r) {
|
|
359
356
|
return r.name === name;
|
|
360
357
|
}) != null) {
|
|
@@ -363,8 +360,8 @@ function AuthScapeApp(_ref) {
|
|
|
363
360
|
return false;
|
|
364
361
|
}
|
|
365
362
|
};
|
|
366
|
-
|
|
367
|
-
if (currentUser.
|
|
363
|
+
signedInUser.HasPermission = function (name) {
|
|
364
|
+
if (currentUser.permissions.find(function (r) {
|
|
368
365
|
return r === name;
|
|
369
366
|
}) != null) {
|
|
370
367
|
return true;
|
|
@@ -372,7 +369,7 @@ function AuthScapeApp(_ref) {
|
|
|
372
369
|
return false;
|
|
373
370
|
}
|
|
374
371
|
};
|
|
375
|
-
return
|
|
372
|
+
return signedInUser;
|
|
376
373
|
};
|
|
377
374
|
var useStore = (0, _zustand.create)(function (set) {
|
|
378
375
|
return store;
|
package/package.json
CHANGED
|
@@ -337,11 +337,9 @@ export function AuthScapeApp ({Component, layout, loadingLayout, pageProps, muiT
|
|
|
337
337
|
|
|
338
338
|
const GetSignedInUser = () => {
|
|
339
339
|
|
|
340
|
-
let
|
|
340
|
+
let signedInUser = signedInUser.current;
|
|
341
341
|
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
_signedInUser.HasRole = function(name) {
|
|
342
|
+
signedInUser.HasRole = function(name) {
|
|
345
343
|
|
|
346
344
|
if (currentUser.roles.find(r => r.name === name) != null)
|
|
347
345
|
{
|
|
@@ -354,9 +352,9 @@ export function AuthScapeApp ({Component, layout, loadingLayout, pageProps, muiT
|
|
|
354
352
|
|
|
355
353
|
};
|
|
356
354
|
|
|
357
|
-
|
|
355
|
+
signedInUser.HasPermission = function(name) {
|
|
358
356
|
|
|
359
|
-
if (currentUser.
|
|
357
|
+
if (currentUser.permissions.find(r => r === name) != null)
|
|
360
358
|
{
|
|
361
359
|
return true;
|
|
362
360
|
}
|
|
@@ -367,7 +365,7 @@ export function AuthScapeApp ({Component, layout, loadingLayout, pageProps, muiT
|
|
|
367
365
|
|
|
368
366
|
};
|
|
369
367
|
|
|
370
|
-
return
|
|
368
|
+
return signedInUser;
|
|
371
369
|
}
|
|
372
370
|
|
|
373
371
|
|