User and User type from the old businesslogic assembly are GONE!

This commit is contained in:
Shannon
2016-03-16 17:52:08 +01:00
parent f594a1132d
commit 9ac2d04aea
85 changed files with 367 additions and 1613 deletions

View File

@@ -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>