Why are the results different on Permission Check for my Custom Application?


the permission check is not what I expected.. so for an owner, both of these checks are true. but for say Manager, given the Can Create Map App permission is changed from the default, check1 returns false, check2 returns true.
Should the results both be true?

 public boolCanCreate(int userId, Guid containerTypeId, Guid containerId){
              PermissionCheck check1 = TEApi.Permissions.Get(UI.Permissions.MapAppPermissionRegistrar.CreateGroupMapApps, userId );
              PermissionCheck check2 = TEApi.Permissions.Get(UI.Permissions.MapAppPermissionRegistrar.CreateGroupMapApps, userId,containerId,containerTypeId, _entityPermissionType );
 
            return check1.IsAllowed || check2.IsAllowed;  
            
        }


a related post is here

heads up to     

Parents Reply
  • Sorry, I am having problems with setting the explicit DefaultContentPermissionId and "implement ISecuredContentType.Get" 
    I'm using the IContent provided in the method as ISecuredContentType but I was expecting to get the default permission id. (you said use the contentTypeId so updated code below)

    #region SecuredContentType  
            private static readonly Guid _readMapsId = InternalApi.VerintDataService.ReadMapsId;
           
            Guid ISecuredContentType.DefaultPermissionId { get { return _readMapsId; } }
    
            Guid ISecuredContentType.DefaultContentPermissionId { get { return _contentTypeId; } }
    
            public Guid DefaultContentPermissionId { get; private set; }
            public Guid DefaultPermissionId { get; private set; }
            public Guid GetContentPermissionId(IContent content)
            { 
                var securedContent  = content as ISecuredContentType;
                
                var contentPermissionId = securedContent.Get(DefaultPermissionId) ;
    
                return contentPermissionId.ContentTypeId;
            }
    
            public Guid GetSecurableId(IContent content)
            {
                return content.Application.ApplicationId;
            }
     
            #endregion

Children