authscape 1.0.562 → 1.0.568
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 +29 -22
- package/package.json +1 -1
- package/src/components/AuthScapeApp.js +36 -24
package/index.js
CHANGED
|
@@ -350,29 +350,36 @@ function AuthScapeApp(_ref) {
|
|
|
350
350
|
}
|
|
351
351
|
};
|
|
352
352
|
var GetSignedInUser = function GetSignedInUser() {
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
353
|
+
if (signedInUser != null) {
|
|
354
|
+
var _signedInUser = signedInUser.current;
|
|
355
|
+
if (_signedInUser != null) {
|
|
356
|
+
_signedInUser.HasRole = function (name) {
|
|
357
|
+
if (currentUser.roles != null) {
|
|
358
|
+
if (currentUser.roles.find(function (r) {
|
|
359
|
+
return r.name === name;
|
|
360
|
+
}) != null) {
|
|
361
|
+
return true;
|
|
362
|
+
} else {
|
|
363
|
+
return false;
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
};
|
|
367
|
+
_signedInUser.HasPermission = function (name) {
|
|
368
|
+
if (currentUser.permissions != null) {
|
|
369
|
+
if (currentUser.permissions.find(function (r) {
|
|
370
|
+
return r === name;
|
|
371
|
+
}) != null) {
|
|
372
|
+
return true;
|
|
373
|
+
} else {
|
|
374
|
+
return false;
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
};
|
|
373
378
|
}
|
|
374
|
-
|
|
375
|
-
|
|
379
|
+
return _signedInUser;
|
|
380
|
+
} else {
|
|
381
|
+
return null;
|
|
382
|
+
}
|
|
376
383
|
};
|
|
377
384
|
var useStore = (0, _zustand.create)(function (set) {
|
|
378
385
|
return store;
|
package/package.json
CHANGED
|
@@ -337,37 +337,49 @@ export function AuthScapeApp ({Component, layout, loadingLayout, pageProps, muiT
|
|
|
337
337
|
|
|
338
338
|
const GetSignedInUser = () => {
|
|
339
339
|
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
_signedInUser.HasRole = function(name) {
|
|
340
|
+
if (signedInUser != null)
|
|
341
|
+
{
|
|
342
|
+
let _signedInUser = signedInUser.current;
|
|
345
343
|
|
|
346
|
-
if (
|
|
347
|
-
{
|
|
348
|
-
return true;
|
|
349
|
-
}
|
|
350
|
-
else
|
|
344
|
+
if (_signedInUser != null)
|
|
351
345
|
{
|
|
352
|
-
|
|
353
|
-
}
|
|
346
|
+
_signedInUser.HasRole = function(name) {
|
|
354
347
|
|
|
355
|
-
|
|
348
|
+
if (currentUser.roles != null)
|
|
349
|
+
{
|
|
350
|
+
if (currentUser.roles.find(r => r.name === name) != null)
|
|
351
|
+
{
|
|
352
|
+
return true;
|
|
353
|
+
}
|
|
354
|
+
else
|
|
355
|
+
{
|
|
356
|
+
return false;
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
};
|
|
356
360
|
|
|
357
|
-
|
|
361
|
+
_signedInUser.HasPermission = function(name) {
|
|
358
362
|
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
363
|
+
if (currentUser.permissions != null)
|
|
364
|
+
{
|
|
365
|
+
if (currentUser.permissions.find(r => r === name) != null)
|
|
366
|
+
{
|
|
367
|
+
return true;
|
|
368
|
+
}
|
|
369
|
+
else
|
|
370
|
+
{
|
|
371
|
+
return false;
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
};
|
|
366
375
|
}
|
|
367
376
|
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
377
|
+
return _signedInUser;
|
|
378
|
+
}
|
|
379
|
+
else
|
|
380
|
+
{
|
|
381
|
+
return null;
|
|
382
|
+
}
|
|
371
383
|
}
|
|
372
384
|
|
|
373
385
|
|