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)
|
||||
{
|
||||
if (idUser == 1)
|
||||
return true;
|
||||
|
||||
var relationsToRoles = cacheRelationUserToRoles.Where(r=>r.IdUser == idUser);
|
||||
if (relationsToRoles is null)
|
||||
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);
|
||||
}
|
||||
|
||||
#warning Проверка прав отключена.
|
||||
isAuthorized = true;
|
||||
//#warning Проверка прав отключена.
|
||||
// isAuthorized = true;
|
||||
if (isAuthorized)
|
||||
await next?.Invoke(context);
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user