20 lines
627 B
C#
20 lines
627 B
C#
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);
|
|
}
|
|
}
|
|
} |