Пример #1
0
 /// <summary>
 /// Gets the highest permission level that a user has
 /// </summary>
 /// <param name="webUrl"></param>
 /// <returns></returns>
 public GetPermissionNameResponse GetUsersPermissionLevelName(string webUrl)
 {
     GetPermissionNameResponse result = new GetPermissionNameResponse() { HasError = false };
     
     GetPermissionLevelResponse response = GetUsersPermissionLevel(webUrl);
     if (!response.HasError)
     {
         result.Result = GlymaPermissionLevelHelper.GetPermissionLevelName(response.Result);
     }
     else
     {
         result.HasError = true;
         result.ErrorMessage = response.ErrorMessage;
     }
     return result;
 }
Пример #2
0
        /// <summary>
        /// Gets the highest permission (role) name that the current user has if they have access to the object
        /// </summary>
        /// <param name="webUrl">The URL for the SP site</param>
        /// <param name="securableObject">An object that contains the Parent and Object ID's 
        ///                                 SecurableParentUid: The ID of the securable parent (Guid.Empty for projects), 
        ///                                 SecurableObjectUid: The ID of the securable object (root map UID or project UID if securing a project)</param>
        /// <returns>The Glyma permission level name if the user has access or null if the user doens't have access</returns>
        public GetPermissionNameResponse GetPermissionNameForObject(string webUrl, GlymaSecurableObject securableObject)
        {
            GetPermissionNameResponse result = new GetPermissionNameResponse() { HasError = false };

            GetPermissionLevelResponse response = GetPermissionLevelForObject(webUrl, securableObject);
            if (!response.HasError)
            {
                result.Result = GlymaPermissionLevelHelper.GetPermissionLevelName(response.Result);
            }
            else
            {
                result.HasError = true;
                result.ErrorMessage = response.ErrorMessage;
            }

            return result;
        }