Factored out Contants.*** Role into RoleNames.***
Renamed 'AllUsers' to 'Everyone'
This commit is contained in:
@ -85,14 +85,14 @@ namespace Oqtane.Security
|
||||
if (permission.StartsWith("!"))
|
||||
{
|
||||
string denyRole = permission.Replace("!", "");
|
||||
if (denyRole == Constants.AllUsersRole || IsAllowed(userId, roles, denyRole))
|
||||
if (denyRole == RoleNames.Everyone || IsAllowed(userId, roles, denyRole))
|
||||
{
|
||||
allowed = false;
|
||||
}
|
||||
}
|
||||
else // grant permission
|
||||
{
|
||||
if (permission == Constants.AllUsersRole || IsAllowed(userId, roles, permission))
|
||||
if (permission == RoleNames.Everyone || IsAllowed(userId, roles, permission))
|
||||
{
|
||||
allowed = true;
|
||||
}
|
||||
|
@ -1,10 +1,9 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
|
||||
namespace Oqtane.Shared
|
||||
{
|
||||
public class Constants
|
||||
{
|
||||
namespace Oqtane.Shared {
|
||||
|
||||
public class Constants {
|
||||
public const string PackageId = "Oqtane.Framework";
|
||||
public const string Version = "1.0.4";
|
||||
public const string ReleaseVersions = "1.0.0,1.0.1,1.0.2,1.0.3,1.0.4";
|
||||
@ -41,10 +40,16 @@ namespace Oqtane.Shared
|
||||
public const string MasterTenant = "Master";
|
||||
public const string DefaultSite = "Default Site";
|
||||
|
||||
public const string AllUsersRole = "All Users";
|
||||
public const string HostRole = "Host Users";
|
||||
public const string AdminRole = "Administrators";
|
||||
public const string RegisteredRole = "Registered Users";
|
||||
const string RoleObsoleteMessage = "Use the corresponding memeber from Oqtane.Shared.RoleNames";
|
||||
|
||||
[Obsolete(RoleObsoleteMessage)]
|
||||
public const string AllUsersRole = RoleNames.Everyone;
|
||||
[Obsolete(RoleObsoleteMessage)]
|
||||
public const string HostRole = RoleNames.Host;
|
||||
[Obsolete(RoleObsoleteMessage)]
|
||||
public const string AdminRole = RoleNames.Admin;
|
||||
[Obsolete(RoleObsoleteMessage)]
|
||||
public const string RegisteredRole = RoleNames.Registered;
|
||||
|
||||
public const string ImageFiles = "jpg,jpeg,jpe,gif,bmp,png,svg,ico";
|
||||
public const string UploadableFiles = "jpg,jpeg,jpe,gif,bmp,png,svg,ico,mov,wmv,avi,mp4,mp3,doc,docx,xls,xlsx,ppt,pptx,pdf,txt,zip,nupkg,csv";
|
||||
|
8
Oqtane.Shared/Shared/RoleNames.cs
Normal file
8
Oqtane.Shared/Shared/RoleNames.cs
Normal file
@ -0,0 +1,8 @@
|
||||
namespace Oqtane.Shared {
|
||||
public class RoleNames {
|
||||
public const string Everyone = "All Users";
|
||||
public const string Host = "Host Users";
|
||||
public const string Admin = "Administrators";
|
||||
public const string Registered = "Registered Users";
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user