Getting content publishing/unpublishing hooked up (from the content item list)

- moved publishing control to the Contents module
- included some prep for adding bulk actions and filtering to the content item list
- publish, unpublish and remove actions need downlevel interstitial pages (functionality only workes w/ JS at the moment)

--HG--
branch : dev
This commit is contained in:
Nathan Heskew
2010-07-16 00:49:24 -07:00
parent fd3d722860
commit 7d6b76d7f5
15 changed files with 150 additions and 49 deletions

View File

@@ -0,0 +1,58 @@
using System.Collections.Generic;
using Orchard.Security.Permissions;
namespace Orchard.Core.Contents {
public class Permissions : IPermissionProvider {
public static readonly Permission PublishOthersContent = new Permission { Description = "Publish or unpublish content for others", Name = "PublishOthersContent" };
public static readonly Permission PublishContent = new Permission { Description = "Publish or unpublish content", Name = "PublishContent", ImpliedBy = new[] { PublishOthersContent } };
public static readonly Permission EditOthersContent = new Permission { Description = "Edit content for others", Name = "EditOthersContent", ImpliedBy = new[] { PublishOthersContent } };
public static readonly Permission EditContent = new Permission { Description = "Edit content", Name = "EditContent", ImpliedBy = new[] { EditOthersContent, PublishContent } };
public static readonly Permission DeleteOthersContent = new Permission { Description = "Delete content for others", Name = "DeleteOthersContent" };
public static readonly Permission DeleteContent = new Permission { Description = "Delete content", Name = "DeleteContent", ImpliedBy = new[] { DeleteOthersContent } };
public static readonly Permission MetaListContent = new Permission { ImpliedBy = new[] { EditContent, PublishContent, DeleteContent } };
public string ModuleName {
get {
return "Content";
}
}
public IEnumerable<Permission> GetPermissions() {
return new Permission[] {
EditContent,
EditOthersContent,
PublishContent,
PublishOthersContent,
DeleteContent,
DeleteOthersContent,
};
}
public IEnumerable<PermissionStereotype> GetDefaultStereotypes() {
return new[] {
new PermissionStereotype {
Name = "Administrator",
Permissions = new[] {PublishOthersContent,EditOthersContent,DeleteOthersContent}
},
new PermissionStereotype {
Name = "Editor",
Permissions = new[] {PublishOthersContent,EditOthersContent,DeleteOthersContent}
},
new PermissionStereotype {
Name = "Moderator",
//Permissions = new[] {}
},
new PermissionStereotype {
Name = "Author",
Permissions = new[] {PublishContent,EditContent,DeleteContent}
},
new PermissionStereotype {
Name = "Contributor",
Permissions = new[] {EditContent}
},
};
}
}
}