mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +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) {
|
public void GetNavigation(NavigationBuilder builder) {
|
||||||
builder.Add(T("Themes"), "25",
|
builder.Add(T("Themes"), "25",
|
||||||
menu => menu.Add(T("List"), "0", item => item.Action("Index", "Admin", new { area = "Orchard.Themes" })
|
menu => menu.Add(T("List"), "0", item => item.Action("Index", "Admin", new { area = "Orchard.Themes" })
|
||||||
.Permission(Permissions.ManageThemes)
|
|
||||||
.Permission(Permissions.ApplyTheme)));
|
.Permission(Permissions.ApplyTheme)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -9,6 +9,7 @@ using Orchard.Environment.Extensions.Models;
|
|||||||
using Orchard.Environment.Features;
|
using Orchard.Environment.Features;
|
||||||
using Orchard.Localization;
|
using Orchard.Localization;
|
||||||
using Orchard.Reports.Services;
|
using Orchard.Reports.Services;
|
||||||
|
using Orchard.Security;
|
||||||
using Orchard.Themes.Preview;
|
using Orchard.Themes.Preview;
|
||||||
using Orchard.Themes.Services;
|
using Orchard.Themes.Services;
|
||||||
using Orchard.Themes.ViewModels;
|
using Orchard.Themes.ViewModels;
|
||||||
@@ -164,7 +165,7 @@ namespace Orchard.Themes.Controllers {
|
|||||||
|
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public ActionResult Update(string themeName) {
|
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();
|
return new HttpUnauthorizedResult();
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(themeName))
|
if (string.IsNullOrEmpty(themeName))
|
||||||
|
@@ -4,14 +4,12 @@ using Orchard.Security.Permissions;
|
|||||||
|
|
||||||
namespace Orchard.Themes {
|
namespace Orchard.Themes {
|
||||||
public class Permissions : IPermissionProvider {
|
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 static readonly Permission ApplyTheme = new Permission { Description = "Apply a Theme", Name = "ApplyTheme" };
|
||||||
|
|
||||||
public virtual Feature Feature { get; set; }
|
public virtual Feature Feature { get; set; }
|
||||||
|
|
||||||
public IEnumerable<Permission> GetPermissions() {
|
public IEnumerable<Permission> GetPermissions() {
|
||||||
return new[] {
|
return new[] {
|
||||||
ManageThemes,
|
|
||||||
ApplyTheme,
|
ApplyTheme,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -20,7 +18,7 @@ namespace Orchard.Themes {
|
|||||||
return new[] {
|
return new[] {
|
||||||
new PermissionStereotype {
|
new PermissionStereotype {
|
||||||
Name = "Administrator",
|
Name = "Administrator",
|
||||||
Permissions = new[] {ManageThemes, ApplyTheme}
|
Permissions = new[] {ApplyTheme}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user