Fix #2230 - add support for an Unauthenticated User global role
This commit is contained in:
@ -104,11 +104,14 @@ namespace Oqtane.Security
|
||||
|
||||
private static bool IsAllowed(int userId, string roles, string permission)
|
||||
{
|
||||
if (permission == RoleNames.Unauthenticated)
|
||||
{
|
||||
return userId == -1;
|
||||
}
|
||||
if ("[" + userId + "]" == permission)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (roles != null)
|
||||
{
|
||||
return roles.IndexOf(";" + permission + ";") != -1;
|
||||
|
Reference in New Issue
Block a user