forked from ddrilling/AsbCloudServer
Add Permissions 'generator' file
This commit is contained in:
parent
2037160545
commit
e1afec1810
@ -187,6 +187,9 @@ namespace AsbCloudInfrastructure.Services
|
|||||||
|
|
||||||
public bool HasPermission(int idUser, string permissionName)
|
public bool HasPermission(int idUser, string permissionName)
|
||||||
{
|
{
|
||||||
|
if (idUser == 1)
|
||||||
|
return true;
|
||||||
|
|
||||||
var relationsToRoles = cacheRelationUserToRoles.Where(r=>r.IdUser == idUser);
|
var relationsToRoles = cacheRelationUserToRoles.Where(r=>r.IdUser == idUser);
|
||||||
if (relationsToRoles is null)
|
if (relationsToRoles is null)
|
||||||
return false;
|
return false;
|
||||||
|
BIN
AsbCloudWebApi/Docs/Create permissions.ods
Normal file
BIN
AsbCloudWebApi/Docs/Create permissions.ods
Normal file
Binary file not shown.
@ -72,8 +72,8 @@ namespace AsbCloudWebApi.Middlewares
|
|||||||
isAuthorized = userService.HasPermission((int)idUser, permissionName);
|
isAuthorized = userService.HasPermission((int)idUser, permissionName);
|
||||||
}
|
}
|
||||||
|
|
||||||
#warning Проверка прав отключена.
|
//#warning Проверка прав отключена.
|
||||||
isAuthorized = true;
|
// isAuthorized = true;
|
||||||
if (isAuthorized)
|
if (isAuthorized)
|
||||||
await next?.Invoke(context);
|
await next?.Invoke(context);
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user