Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • Zihadul Azam 26 posts 171 karma points c-trib
    Sep 25, 2017 @ 09:55
    Zihadul Azam

    Hide users of other groups

    Currently, I'm building a collection of websites similar to this one:

    enter image description here

    Now I want to create an admin for each site and give him the permission to manage his site users (create an editor, delete editor...). But I noticed that, if I give him the User Section permission he can see also the other sites users (other groups).

    In short words: I would like to have: every site has a group of users, there is an Admin who can manage them and he can't see (edit) other sites users

    Is there any solution?

    Umbraco Version: 7.7.1


  • Alex Skrypnyk 6060 posts 23282 karma points MVP 6x admin c-trib
    Sep 25, 2017 @ 20:32
    Alex Skrypnyk

    Hi Zihadul

    The easiest way to use Umbraco instance per site, can you just copy your Umbraco for each website? Why do you need to store everything in one Umbraco?



  • Zihadul Azam 26 posts 171 karma points c-trib
    Sep 26, 2017 @ 07:40
    Zihadul Azam

    Hii Alex,

    Yes, I've to run all websites (150-200 websites) in one single Umbraco installation, because they have relations between them (Ex: Sharing Content).

    Everything is excellent in Umbraco, only the Hierarchical User Management is missing. It would be fantastic if the next Umbraco version includes this function, because I read a lot of comments where the developers are demanding.


  • Zihadul Azam 26 posts 171 karma points c-trib
    Oct 11, 2017 @ 09:19
    Zihadul Azam

    I solved this problem using angularJs Interceptor. I intercept the result of the Umbraco Core user controller, then filter users.

    angular.module('').config(function ($httpProvider) {
        $httpProvider.interceptors.push(function ($q, $injector) {
            return {
                'request': function (request) {
                    if (request.url.includes("umbraco/backoffice/UmbracoApi/Users/GetPagedUsers")) {
                        // set page Size 1025 (to get all users & filter them), by default umbraco request only 25 users
                        var splittedUrl = request.url.split("pageSize=");
                        var newUrl = splittedUrl[0] + "pageSize=100" + splittedUrl[1];
                        request.url = newUrl;
                    return request;
                'response': function (response) {
                    // intercept GetPagedUsers response data
                    if (response.config.url.includes("umbraco/backoffice/UmbracoApi/Users/GetPagedUsers")) {
                        //get users
                        var users =;
                        if (users.length > 0) {
                            // umbraco userService
                            var userS = $injector.get('userService');
                            // get Current User
                            return userS.getCurrentUser()
                                .then(function (currentUser)
                                    if (currentUser !== null) {
                                        // if the current user is not super admin (can see all users), then filter
                                        if (!isSuperAdmin(currentUser.userGroups)) {
                                            // get $http
                                            var http = $injector.get('$http');
                                            // get page number
                                            var pageNumber = getPageNumber(response.config.url);
                                            // set page size
                                            var pageSize = 25;
                                            // set send data for custom filter controller
                                            var sendedData = { users: JSON.stringify(users), pageNumber: pageNumber, pageSize: pageSize };
                                            // call custom UmbracoAuthorized Filter controller
                                            return"backoffice/UserInterceptorPlugin/MyUsersController/Filter", angular.toJson(sendedData))
                                                .then(function (res)
                                                    // parse to Json Object
                                                    res = JSON.parse(JSON.parse(;
                                                    // set response data to return 
                                           = res.resUsers;
                                           = res.resUsers.length;
                                           = pageSize;
                                           = res.resUsers.length;
                                           = res.activeUsers;
                                           = res.disabledUsers;
                                           = res.invitedUsers;
                                                    return response;
                                    return response;
                    return response;
        // check if has admin group
        var isSuperAdmin = function (userGroups) {
            var res = false;
            angular.forEach(userGroups, function (group, index) {
                if (group === "admin")
                    res = true;
            return res;
        // get pageNumber param form URL 
        var getPageNumber = function (url) {
            var split = url.split("pageNumber=");
            var number = split[1].split("&");
            return number[0];
Please Sign in or register to post replies

Write your reply to: