From 99a2592ace9c4943bd8fd6e48082e099b4704e49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A4=D1=80=D0=BE=D0=BB=D0=BE=D0=B2?= Date: Mon, 31 Jan 2022 11:09:24 +0500 Subject: [PATCH] Add shorthand to check admins permissions --- AsbCloudInfrastructure/Services/UserRoleService.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/AsbCloudInfrastructure/Services/UserRoleService.cs b/AsbCloudInfrastructure/Services/UserRoleService.cs index 72222274..bd195fd3 100644 --- a/AsbCloudInfrastructure/Services/UserRoleService.cs +++ b/AsbCloudInfrastructure/Services/UserRoleService.cs @@ -185,6 +185,9 @@ namespace AsbCloudInfrastructure.Services if (permissionInfo is null) return false; + if (rolesIds.Contains(1)) + return true; + var idPermissionInfo = permissionInfo.Id; var roles = cacheUserRoles.Where(r => rolesIds.Contains(r.Id)); foreach (var role in roles)