示例#1
0
        /// <summary>
        /// Gets the effective permissions for the provided Sid within the Security Descriptor.
        /// </summary>
        /// <param name="pUserSid">A pointer to the Sid of the identity to check.</param>
        /// <param name="serverName">Name of the server. This can be <c>null</c>.</param>
        /// <param name="pSecurityDescriptor">A pointer to the security descriptor.</param>
        /// <returns>An array of access masks.</returns>
        public virtual uint[] GetEffectivePermission(PSID pUserSid, string serverName, IntPtr pSecurityDescriptor)
        {
            var sd   = new SafeSecurityDescriptor(pSecurityDescriptor, false);
            var mask = pUserSid.GetEffectiveRights(sd);

            return(new[] { mask });
        }
示例#2
0
        /// <summary>
        /// Gets the effective permissions for the provided Sid within the Security Descriptor.
        /// </summary>
        /// <param name="pUserSid">A pointer to the Sid of the identity to check.</param>
        /// <param name="serverName">Name of the server. This can be <c>null</c>.</param>
        /// <param name="pSecurityDescriptor">A pointer to the security descriptor.</param>
        /// <returns>An array of access masks.</returns>
        public virtual ACCESS_MASK[] GetEffectivePermission(PSID pUserSid, string serverName, PSECURITY_DESCRIPTOR pSecurityDescriptor)
        {
            ACCESS_MASK mask = pUserSid.GetEffectiveRights(pSecurityDescriptor);

            return(new[] { mask });
        }