mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 11:44:58 +08:00
16962 Remove theme management permission
--HG-- branch : dev
This commit is contained in:
@@ -9,7 +9,6 @@ namespace Orchard.Themes {
|
||||
public void GetNavigation(NavigationBuilder builder) {
|
||||
builder.Add(T("Themes"), "25",
|
||||
menu => menu.Add(T("List"), "0", item => item.Action("Index", "Admin", new { area = "Orchard.Themes" })
|
||||
.Permission(Permissions.ManageThemes)
|
||||
.Permission(Permissions.ApplyTheme)));
|
||||
}
|
||||
}
|
||||
|
@@ -9,6 +9,7 @@ using Orchard.Environment.Extensions.Models;
|
||||
using Orchard.Environment.Features;
|
||||
using Orchard.Localization;
|
||||
using Orchard.Reports.Services;
|
||||
using Orchard.Security;
|
||||
using Orchard.Themes.Preview;
|
||||
using Orchard.Themes.Services;
|
||||
using Orchard.Themes.ViewModels;
|
||||
@@ -164,7 +165,7 @@ namespace Orchard.Themes.Controllers {
|
||||
|
||||
[HttpPost]
|
||||
public ActionResult Update(string themeName) {
|
||||
if (!Services.Authorizer.Authorize(Permissions.ManageThemes, T("Couldn't update theme")))
|
||||
if (!Services.Authorizer.Authorize(StandardPermissions.SiteOwner, T("Couldn't update theme")))
|
||||
return new HttpUnauthorizedResult();
|
||||
|
||||
if (string.IsNullOrEmpty(themeName))
|
||||
|
@@ -4,14 +4,12 @@ using Orchard.Security.Permissions;
|
||||
|
||||
namespace Orchard.Themes {
|
||||
public class Permissions : IPermissionProvider {
|
||||
public static readonly Permission ManageThemes = new Permission { Description = "Manage Themes", Name = "ManageThemes" };
|
||||
public static readonly Permission ApplyTheme = new Permission { Description = "Apply a Theme", Name = "ApplyTheme" };
|
||||
|
||||
public virtual Feature Feature { get; set; }
|
||||
|
||||
public IEnumerable<Permission> GetPermissions() {
|
||||
return new[] {
|
||||
ManageThemes,
|
||||
ApplyTheme,
|
||||
};
|
||||
}
|
||||
@@ -20,7 +18,7 @@ namespace Orchard.Themes {
|
||||
return new[] {
|
||||
new PermissionStereotype {
|
||||
Name = "Administrator",
|
||||
Permissions = new[] {ManageThemes, ApplyTheme}
|
||||
Permissions = new[] {ApplyTheme}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user