mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 03:25:23 +08:00
- Comments: Permissions
--HG-- extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4041429
This commit is contained in:
@@ -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>
|
||||||
|
30
src/Orchard.Web/Packages/Orchard.Comments/Permissions.cs
Normal file
30
src/Orchard.Web/Packages/Orchard.Comments/Permissions.cs
Normal 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
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user