permission updates
This commit is contained in:
parent
ea463a6548
commit
c2375c897d
|
@ -229,7 +229,8 @@ namespace Oqtane.Controllers
|
|||
authorized = true;
|
||||
if (permissionName == PermissionNames.Edit)
|
||||
{
|
||||
authorized = User.IsInRole(RoleNames.Admin) || _userPermissions.IsAuthorized(User, _alias.SiteId, entityName, entityId, permissionName);
|
||||
authorized = _userPermissions.IsAuthorized(User, _alias.SiteId, entityName, entityId, permissionName) ||
|
||||
_userPermissions.IsAuthorized(User, _alias.SiteId, entityName, -1, PermissionNames.Write, RoleNames.Admin);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -97,6 +97,7 @@ namespace Oqtane.Repository
|
|||
if (current.IsAuthorized != permission.IsAuthorized)
|
||||
{
|
||||
current.IsAuthorized = permission.IsAuthorized;
|
||||
current.Role = null; // remove linked reference to Role which can cause errors in EF Core change tracking
|
||||
_db.Entry(current).State = EntityState.Modified;
|
||||
modified = true;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user