mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-12-02 19:44:02 +08:00
#18823: Fixing permissions inforcement in Orchard.Tags
Work Item: 18823
This commit is contained in:
@@ -26,6 +26,9 @@ namespace Orchard.Tags.Controllers {
|
|||||||
public Localizer T { get; set; }
|
public Localizer T { get; set; }
|
||||||
|
|
||||||
public ActionResult Index() {
|
public ActionResult Index() {
|
||||||
|
if (!Services.Authorizer.Authorize(Permissions.ManageTags, T("Can't manage tags")))
|
||||||
|
return new HttpUnauthorizedResult();
|
||||||
|
|
||||||
IEnumerable<TagRecord> tags = _tagService.GetTags();
|
IEnumerable<TagRecord> tags = _tagService.GetTags();
|
||||||
var entries = tags.Select(CreateTagEntry).ToList();
|
var entries = tags.Select(CreateTagEntry).ToList();
|
||||||
var model = new TagsAdminIndexViewModel { Tags = entries };
|
var model = new TagsAdminIndexViewModel { Tags = entries };
|
||||||
@@ -65,6 +68,9 @@ namespace Orchard.Tags.Controllers {
|
|||||||
[HttpPost, ActionName("Index")]
|
[HttpPost, ActionName("Index")]
|
||||||
[FormValueRequired("submit.Create")]
|
[FormValueRequired("submit.Create")]
|
||||||
public ActionResult IndexCreatePOST() {
|
public ActionResult IndexCreatePOST() {
|
||||||
|
if (!Services.Authorizer.Authorize(Permissions.ManageTags, T("Couldn't create tag")))
|
||||||
|
return new HttpUnauthorizedResult();
|
||||||
|
|
||||||
var viewModel = new TagsAdminCreateViewModel();
|
var viewModel = new TagsAdminCreateViewModel();
|
||||||
|
|
||||||
if (!TryUpdateModel(viewModel)) {
|
if (!TryUpdateModel(viewModel)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user