remove unneeded check for has permission

This commit is contained in:
RaidMax 2022-09-24 10:22:05 -05:00
parent 12da0f463b
commit 1cf99869f6

View File

@ -33,7 +33,7 @@ public class HasPermission : TagHelper
var permissionLevel = _contextAccessor?.HttpContext?.User.Claims var permissionLevel = _contextAccessor?.HttpContext?.User.Claims
.FirstOrDefault(claim => claim.Type == ClaimTypes.Role)?.Value ?? EFClient.Permission.User.ToString(); .FirstOrDefault(claim => claim.Type == ClaimTypes.Role)?.Value ?? EFClient.Permission.User.ToString();
var hasPermission = permissionLevel != null && _permissionSets.ContainsKey(permissionLevel) && var hasPermission = _permissionSets.ContainsKey(permissionLevel) &&
_permissionSets[permissionLevel].HasPermission(Entity, Permission); _permissionSets[permissionLevel].HasPermission(Entity, Permission);
if (!hasPermission) if (!hasPermission)
{ {