Merge branch 'U4-11166' of https://github.com/jamescoxhead/Umbraco-CMS into jamescoxhead-U4-11166

This commit is contained in:
Sebastiaan Janssen
2018-08-26 16:52:58 +02:00
4 changed files with 26 additions and 6 deletions

View File

@@ -219,6 +219,7 @@ namespace Umbraco.Web.Editors
// so to do that here, we'll need to check if this current user is an admin and if not we should exclude all user who are
// also admins
var hideDisabledUsers = UmbracoConfig.For.UmbracoSettings().Security.HideDisabledUsersInBackoffice;
var excludeUserGroups = new string[0];
var isAdmin = Security.CurrentUser.IsAdmin();
if (isAdmin == false)
@@ -241,10 +242,18 @@ namespace Umbraco.Web.Editors
filterQuery.Where(x => x.Name.Contains(filter) || x.Username.Contains(filter));
}
if (hideDisabledUsers)
{
if (userStates == null || userStates.Any() == false)
{
userStates = new[] { UserState.Active, UserState.Invited, UserState.LockedOut, UserState.Inactive };
}
}
long pageIndex = pageNumber - 1;
long total;
var result = Services.UserService.GetAll(pageIndex, pageSize, out total, orderBy, orderDirection, userStates, userGroups, excludeUserGroups, filterQuery);
var paged = new PagedUserResult(total, pageNumber, pageSize)
{
Items = Mapper.Map<IEnumerable<UserBasic>>(result),