From 35548f6ef142e6aee2d804d00dbc5f13609e7b24 Mon Sep 17 00:00:00 2001 From: suhacan Date: Thu, 19 Nov 2009 19:52:02 +0000 Subject: [PATCH] - Comments: Permissions --HG-- extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4041429 --- .../Orchard.Comments/Orchard.Comments.csproj | 1 + .../Packages/Orchard.Comments/Permissions.cs | 30 +++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 src/Orchard.Web/Packages/Orchard.Comments/Permissions.cs diff --git a/src/Orchard.Web/Packages/Orchard.Comments/Orchard.Comments.csproj b/src/Orchard.Web/Packages/Orchard.Comments/Orchard.Comments.csproj index 5a824d86c..14d7989b4 100644 --- a/src/Orchard.Web/Packages/Orchard.Comments/Orchard.Comments.csproj +++ b/src/Orchard.Web/Packages/Orchard.Comments/Orchard.Comments.csproj @@ -62,6 +62,7 @@ + diff --git a/src/Orchard.Web/Packages/Orchard.Comments/Permissions.cs b/src/Orchard.Web/Packages/Orchard.Comments/Permissions.cs new file mode 100644 index 000000000..aa77f859c --- /dev/null +++ b/src/Orchard.Web/Packages/Orchard.Comments/Permissions.cs @@ -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 GetPermissions() { + return new List { + AddComment, + AddCommentWithoutValidation, + CloseComment, + CloseCommentOnOwnItems, + ModerateComment, + ModerateCommentOnOwnItems + }; + } + } +}