User and User type from the old businesslogic assembly are GONE!
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Web.Security;
|
||||
using Umbraco.Core.Models.Membership;
|
||||
|
||||
@@ -6,6 +7,18 @@ namespace Umbraco.Core.Services
|
||||
{
|
||||
internal static class UserServiceExtensions
|
||||
{
|
||||
public static EntityPermission GetPermissions(this IUserService userService, IUser user, string path)
|
||||
{
|
||||
var ids = path.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries)
|
||||
.Select(x => x.TryConvertTo<int>())
|
||||
.Where(x => x.Success)
|
||||
.Select(x => x.Result)
|
||||
.ToArray();
|
||||
if (ids.Length == 0) throw new InvalidOperationException("The path: " + path + " could not be parsed into an array of integers or the path was empty");
|
||||
|
||||
return userService.GetPermissions(user, ids[ids.Length - 1]).FirstOrDefault();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Remove all permissions for this user for all nodes specified
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user