Пример #1
0
        internal static RoleEntryInfo GetRoleInfoForCmdlet(string cmdletFullName)
        {
            RoleEntry roleEntry;

            if (cmdletFullName.Equals("Impersonate-ExchangeUser", StringComparison.OrdinalIgnoreCase))
            {
                roleEntry = new ApplicationPermissionRoleEntry("a," + cmdletFullName);
            }
            else
            {
                string str = RoleEntryInfo.ConvertToCommaSeparatedCmdletName(cmdletFullName);
                roleEntry = new CmdletRoleEntry("c," + str);
            }
            return(new RoleEntryInfo(roleEntry));
        }
        // Token: 0x06001419 RID: 5145 RVA: 0x000489F8 File Offset: 0x00046BF8
        public virtual bool IsWebMethodAvailable(string webMethodName)
        {
            if (string.IsNullOrEmpty(webMethodName))
            {
                throw new ArgumentNullException("webMethodName");
            }
            RoleEntryInfo roleInfoForWebMethod = RoleEntryInfo.GetRoleInfoForWebMethod(webMethodName);
            int           num = this.allRoleEntries.BinarySearch(roleInfoForWebMethod, RoleEntryInfo.NameComparer);

            if (num < 0)
            {
                ExTraceGlobals.AccessCheckTracer.TraceWarning <string, string>((long)this.GetHashCode(), "IsWebMethodAvailable() returns false for user {0} because web method {1} is not in role.", this.identityName, webMethodName);
                return(false);
            }
            return(true);
        }