Add permissions for downloading LeafInput
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using LeafWeb.Core.Entities;
|
||||
using Umbraco.Web.Security;
|
||||
|
||||
namespace LeafWeb.WebCms.Utility
|
||||
{
|
||||
public static class Permissions
|
||||
{
|
||||
public static bool IsCurrentUserAdministrator()
|
||||
{
|
||||
var memberShipHelper = new MembershipHelper(Umbraco.Web.UmbracoContext.Current);
|
||||
return memberShipHelper.IsMemberAuthorized(allowGroups: new[] {"Administrator"});
|
||||
}
|
||||
|
||||
public static bool DoesBelongToUser(this LeafInput leafInput, string username)
|
||||
{
|
||||
return string.Equals(leafInput.Email, username, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user