Copied to clipboard

Flag this post as spam?

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


  • Poornima Nayar 106 posts 276 karma points MVP 6x c-trib
    Feb 02, 2016 @ 13:32
    Poornima Nayar
    0

    Custom property editor available for admin users/ users with elevated permissions only

    Hi,

    Is it possible to create a property editor that is available to admins/ a user type with elevated permissions only in Umbraco?

    Poornima

  • Ravi Motha 290 posts 500 karma points MVP 8x c-trib
    Feb 02, 2016 @ 13:49
    Ravi Motha
    0

    so you would have a document type with the property type attached , and then when viewed in the CMS only the elevated user perms can see the property editor??

    If thats the case you would have to write the angular page to look at the permissions of each user and do an ng=show

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Feb 02, 2016 @ 14:33
    Jan Skovgaard
    0

    Hi Poornima

    Well I'm not sure it's possible to do pr. "type" but it's possible to do pr. "id". And if it's sufficient to only check for the master admin account it's possible using the "userService" and check if the logged in user's id is 0 - If it is then it's the master admin account being logged in.

    So in your controller you could have something like this

    angular.module("umbraco").controller("YourController",['$scope','userService', function($scope, userService){
    
        //Setting the initial value for currentUser to null
        $scope.currentUser = null;
    
        //Fetching the value of the current used logged into the backoffice to determine whether or not admin features should be visible
        var getCurrentUser = userService.getCurrentUser().then(function(dataObj){
            var data = dataObj;
            $scope.currentUser = data.id;
        });
    }]);
    

    And then in your view you could have

    <div ng-if="currentUser === 0">
    <!-- your code here -->
    </div>
    

    I hope this makes any sense :)

    /Jan

  • Poornima Nayar 106 posts 276 karma points MVP 6x c-trib
    Feb 02, 2016 @ 16:33
    Poornima Nayar
    0

    Thanks guys, I ll need to create a POC for this. But having said that any idea whether such custom property editors can be handled by Courier as well?

Please Sign in or register to post replies

Write your reply to:

Draft