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:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user