remove unneeded check for has permission
This commit is contained in:
parent
12da0f463b
commit
1cf99869f6
@ -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)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user