mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 11:44:58 +08:00
16968 Remove manage search index permission
--HG-- branch : dev
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Orchard.Localization;
|
||||
using Orchard.Security;
|
||||
using Orchard.UI.Navigation;
|
||||
|
||||
namespace Orchard.Indexing {
|
||||
@@ -9,7 +10,7 @@ namespace Orchard.Indexing {
|
||||
public void GetNavigation(NavigationBuilder builder) {
|
||||
builder.Add(T("Configuration"), "50",
|
||||
menu => menu.Add(T("Search Index"), "15", item => item.Action("Index", "Admin", new {area = "Orchard.Indexing"})
|
||||
.Permission(Permissions.ManageSearchIndex)));
|
||||
.Permission(StandardPermissions.SiteOwner)));
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,6 +1,7 @@
|
||||
using System.Web.Mvc;
|
||||
using Orchard.Indexing.Services;
|
||||
using Orchard.Localization;
|
||||
using Orchard.Security;
|
||||
using Orchard.UI.Notify;
|
||||
using Orchard.Indexing.ViewModels;
|
||||
|
||||
@@ -28,7 +29,7 @@ namespace Orchard.Indexing.Controllers {
|
||||
|
||||
[HttpPost]
|
||||
public ActionResult Update() {
|
||||
if (!Services.Authorizer.Authorize(Permissions.ManageSearchIndex, T("Not allowed to manage the search index.")))
|
||||
if (!Services.Authorizer.Authorize(StandardPermissions.SiteOwner, T("Not allowed to manage the search index.")))
|
||||
return new HttpUnauthorizedResult();
|
||||
|
||||
_indexingService.UpdateIndex();
|
||||
@@ -38,7 +39,7 @@ namespace Orchard.Indexing.Controllers {
|
||||
|
||||
[HttpPost]
|
||||
public ActionResult Rebuild() {
|
||||
if (!Services.Authorizer.Authorize(Permissions.ManageSearchIndex, T("Not allowed to manage the search index.")))
|
||||
if (!Services.Authorizer.Authorize(StandardPermissions.SiteOwner, T("Not allowed to manage the search index.")))
|
||||
return new HttpUnauthorizedResult();
|
||||
|
||||
_indexingService.RebuildIndex();
|
||||
|
@@ -55,7 +55,6 @@
|
||||
<Compile Include="Handlers\InfosetFieldIndexingHandler.cs" />
|
||||
<Compile Include="Models\IndexingTask.cs" />
|
||||
<Compile Include="Models\IndexingTaskRecord.cs" />
|
||||
<Compile Include="Permissions.cs" />
|
||||
<Compile Include="Services\IndexServiceNotificationProvider.cs" />
|
||||
<Compile Include="Services\IndexingBackgroundTask.cs" />
|
||||
<Compile Include="Services\IndexingTaskExecutor.cs" />
|
||||
|
@@ -1,24 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using Orchard.Environment.Extensions.Models;
|
||||
using Orchard.Security.Permissions;
|
||||
|
||||
namespace Orchard.Indexing {
|
||||
public class Permissions : IPermissionProvider {
|
||||
public static readonly Permission ManageSearchIndex = new Permission { Description = "Manage Search Index", Name = "ManageSearchIndex" };
|
||||
|
||||
public virtual Feature Feature { get; set; }
|
||||
|
||||
public IEnumerable<Permission> GetPermissions() {
|
||||
return new[] { ManageSearchIndex };
|
||||
}
|
||||
|
||||
public IEnumerable<PermissionStereotype> GetDefaultStereotypes() {
|
||||
return new[] {
|
||||
new PermissionStereotype {
|
||||
Name = "Administrator",
|
||||
Permissions = new [] { ManageSearchIndex }
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user