public static bool HasPermission(PermissionsEnum permissionsEnum, User user) { var permission = PermissionsMapper.GetPermissionsFromEnum(permissionsEnum); if (permission == null) { return(false); } var roles = RolesMapper.FilterWithPermission(user.Roles, permission); return(roles.Any()); }
public static IEnumerable <Permission> GetNotInRolesPermissions(User user, IMediaDetail mediaDetail) { return(PermissionsMapper.FilterOutList(PermissionsMapper.GetAllActive(), GetUserRolesPermissions(user, mediaDetail))); }