- Blogs: Permissions for the package.

--HG--
extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4042987
This commit is contained in:
suhacan
2009-12-02 23:21:52 +00:00
parent d42a81b005
commit 0989f2a55a
2 changed files with 37 additions and 0 deletions

View File

@@ -71,6 +71,7 @@
<Compile Include="Extensions\BlogPostCreateViewModelExtensions.cs" />
<Compile Include="Extensions\HtmlHelperExtensions.cs" />
<Compile Include="Extensions\UrlHelperExtensions.cs" />
<Compile Include="Permissions.cs" />
<Compile Include="Routing\IsBlogConstraint.cs" />
<Compile Include="Services\BlogService.cs" />
<Compile Include="Controllers\BlogController.cs" />

View File

@@ -0,0 +1,36 @@
using System.Collections.Generic;
using Orchard.Security.Permissions;
namespace Orchard.Blogs {
public class Permissions : IPermissionProvider {
public static readonly Permission ViewPost = new Permission { Description = "Viewing Blog Posts", Name = "ViewPosts" };
public static readonly Permission CreatePost = new Permission { Description = "Creating Blog Posts", Name = "CreatePost" };
public static readonly Permission CreateDraft = new Permission { Description = "Creating a Draft of a Blog Post", Name = "CreateDraft" };
public static readonly Permission ModifyPost = new Permission { Description = "Mofifying a Blog Post", Name = "ModifyPost" };
public static readonly Permission DeletePost = new Permission { Description = "Deleting a Blog Post", Name = "DeletePost" };
public static readonly Permission PublishPost = new Permission { Description = "Publishing a Blog Post", Name = "PublishPost" };
public static readonly Permission UnpublishPost = new Permission { Description = "Unpublishing a Blog Post", Name = "UnpublishPost" };
public static readonly Permission SchedulePost = new Permission { Description = "Scheduling a Blog Post", Name = "SchedulePost" };
public string PackageName {
get {
return "Blogs";
}
}
public IEnumerable<Permission> GetPermissions() {
return new List<Permission> {
ViewPost,
CreatePost,
CreateDraft,
ModifyPost,
DeletePost,
PublishPost,
UnpublishPost,
SchedulePost
};
}
}
}