static string AccessMaskToString(uint granted_access, bool directory)
        {
            if (_type.HasFullPermission(granted_access))
            {
                return("Full Permission");
            }

            if (directory)
            {
                FileDirectoryAccessRights rights = (FileDirectoryAccessRights)granted_access;
                return(rights.ToString());
            }
            else
            {
                FileAccessRights rights = (FileAccessRights)granted_access;
                return(rights.ToString());
            }
        }
Esempio n. 2
0
        static string AccessMaskToString(uint granted_access, bool directory)
        {
            if (_type.HasFullPermission(granted_access))
            {
                return("Full Permission");
            }
            string file_rights;

            if (directory)
            {
                FileDirectoryAccessRights rights = (FileDirectoryAccessRights)(granted_access & 0x1FF);
                file_rights = rights.ToString();
            }
            else
            {
                FileAccessRights rights = (FileAccessRights)(granted_access & 0x1FF);
                file_rights = rights.ToString();
            }

            StandardAccessRights standard = (StandardAccessRights)(granted_access & 0x1F0000);

            return(String.Join(", ", new string[] { standard.ToString(), file_rights }));
        }