larger refactor so we don't need to worry about 'loading' a users groups, it will all just be done, updated queries to fetch a user, it's groups and it's sections all at once, it might be a little heavy but we'll see. Adds/removes a few other methods that didn't seem right and uses group aliases for most things, adds Datbase unique indexes for group aliases and names (need to fix tests though)

This commit is contained in:
Shannon
2017-05-10 21:00:30 +10:00
parent f594006b95
commit 512f3237f0
26 changed files with 502 additions and 338 deletions

View File

@@ -92,7 +92,7 @@ namespace Umbraco.Core.Models
public static bool IsAdmin(this IUser user)
{
if (user == null) throw new ArgumentNullException("user");
return user.Groups != null && user.Groups.Any(x => x.Alias == "admin");
return user.Groups != null && user.Groups.Any(x => x == Constants.Security.AdminGroupAlias);
}
}
}