Skip to content

Commit

Permalink
Rename ReverseProxySettings permission to ManageReverseProxySettings (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
hishamco authored Apr 21, 2022
1 parent 68fdb61 commit 93f7d6e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public Task BuildNavigationAsync(string name, NavigationBuilder builder)
.Add(S["Reverse Proxy"], S["Reverse Proxy"].PrefixPosition(), entry => entry
.AddClass("reverseproxy").Id("reverseproxy")
.Action("Index", "Admin", new { area = "OrchardCore.Settings", groupId = "ReverseProxy" })
.Permission(Permissions.ReverseProxySettings)
.Permission(Permissions.ManageReverseProxySettings)
.LocalNav()
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public override async Task<IDisplayResult> EditAsync(ReverseProxySettings settin
{
var user = _httpContextAccessor.HttpContext?.User;

if (!await _authorizationService.AuthorizeAsync(user, Permissions.ReverseProxySettings))
if (!await _authorizationService.AuthorizeAsync(user, Permissions.ManageReverseProxySettings))
{
return null;
}
Expand All @@ -53,7 +53,7 @@ public override async Task<IDisplayResult> UpdateAsync(ReverseProxySettings sect
{
var user = _httpContextAccessor.HttpContext?.User;

if (!await _authorizationService.AuthorizeAsync(user, Permissions.ReverseProxySettings))
if (!await _authorizationService.AuthorizeAsync(user, Permissions.ManageReverseProxySettings))
{
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ namespace OrchardCore.ReverseProxy
{
public class Permissions : IPermissionProvider
{
public static readonly Permission ReverseProxySettings = new Permission("ReverseProxySettings", "Manage Reverse Proxy Settings");
public static readonly Permission ManageReverseProxySettings = new Permission("ManageReverseProxySettings", "Manage Reverse Proxy Settings");

public Task<IEnumerable<Permission>> GetPermissionsAsync()
{
return Task.FromResult(new[] { ReverseProxySettings }.AsEnumerable());
return Task.FromResult(new[] { ManageReverseProxySettings }.AsEnumerable());
}

public IEnumerable<PermissionStereotype> GetDefaultStereotypes()
Expand All @@ -21,7 +21,7 @@ public IEnumerable<PermissionStereotype> GetDefaultStereotypes()
new PermissionStereotype
{
Name = "Administrator",
Permissions = new[] { ReverseProxySettings }
Permissions = new[] { ManageReverseProxySettings }
},
};
}
Expand Down

0 comments on commit 93f7d6e

Please sign in to comment.