- Comments: Permissions

--HG--
extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4041429
This commit is contained in:
suhacan
2009-11-19 19:52:02 +00:00
parent 70a94fbfb6
commit 35548f6ef1
2 changed files with 31 additions and 0 deletions

View File

@@ -62,6 +62,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Models\CommentSettings.cs" /> <Compile Include="Models\CommentSettings.cs" />
<Compile Include="Permissions.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@@ -0,0 +1,30 @@
using System.Collections.Generic;
using Orchard.Security.Permissions;
namespace Orchard.Comments {
public class Permissions : IPermissionProvider {
public static readonly Permission AddComment = new Permission { Description = "Adding a Comment", Name = "AddComment" };
public static readonly Permission AddCommentWithoutValidation = new Permission { Description = "Adding a Comment without validation", Name = "AddCommentWithoutValidation" };
public static readonly Permission CloseComment = new Permission { Description = "Closing Comments", Name = "CloseComment" };
public static readonly Permission CloseCommentOnOwnItems = new Permission { Description = "Closing Comments on own items", Name = "CloseCommentOnOwnItems" };
public static readonly Permission ModerateComment = new Permission { Description = "Moderating Comments", Name = "ModerateComment" };
public static readonly Permission ModerateCommentOnOwnItems = new Permission { Description = "Moderating Comments On Own Items", Name = "ModerateCommentOnOwnItems" };
public string PackageName {
get {
return "Comments";
}
}
public IEnumerable<Permission> GetPermissions() {
return new List<Permission> {
AddComment,
AddCommentWithoutValidation,
CloseComment,
CloseCommentOnOwnItems,
ModerateComment,
ModerateCommentOnOwnItems
};
}
}
}