Example #1
0
        private void displayIt(SushiSecurable secSite)
        {
            if (!secSite.AtLeastOnePermission)
                return;

            AddToRtbLocal("\r\n" + secSite.Name, StyleType.bodyBlueBold);
            string s = chkShowLinkToManagePermissions.Checked ? secSite.HyperLinkSiteSecurity + "\r\n" : "\r\n";
            SmartStepUtil.AddToRTB(rtbDisplay, " " + s, Color.DarkGray, 4, false);
            displayRoles(secSite, "   ");
            foreach (SushiSecurable secList in secSite.SecurableLists)
            {
                AddToRtbLocal("   " + secList.Name, StyleType.bodySeaGreen);
                SmartStepUtil.AddToRTB(rtbDisplay, " (" + secList.ListType + ")", Color.SeaGreen, 8, false);
                string s2 = chkShowLinkToManagePermissions.Checked ? secList.HyperLinkSiteSecurity + "\r\n" : "\r\n";
                SmartStepUtil.AddToRTB(rtbDisplay, " " + s2, Color.DarkGray, 5, false);
                displayRoles(secList, "      ");
            }
            SmartStepUtil.ScrollToBottom(rtbDisplay);
        }
Example #2
0
        private void displayRoles(SushiSecurable sec, string indentSpaces)
        {
            foreach (UorG uorG in sec.UorGs)
            {
                AddToRtbLocal(indentSpaces + uorG.Name, uorG.IsADgroup ? StyleType.bodyMidnightBlue : StyleType.bodyBlack);
                foreach (string role in uorG.RoleNames)
                    AddToRtbLocal(" [" + role + "]", StyleType.bodyBlack);

                AddToRtbLocal("\r\n", StyleType.bodyBlack);
            }
        }
Example #3
0
        private SushiSecurable findRoleAssignmentsForMember(ISecurableObject webOrList, SPUser user, List<string> userSharepointGroups, List<string> userADgroups)
        {
            SushiSecurable secSiteOrList = new SushiSecurable();

            if (!webOrList.HasUniqueRoleAssignments && !chkShowOnlyUnique.Checked)
                return secSiteOrList;

            foreach (SPRoleAssignment ra in webOrList.RoleAssignments)
            {
                string raName = ra.Member.Name.ToUpper();
                if (raName == user.Name.ToUpper() || userSharepointGroups.Contains(raName) || userADgroups.Contains(raName))
                {
                    UorG uOrG = new UorG(ra.Member.Name, userADgroups.Contains(raName));
                    if (ra.Member.Name.ToUpper() == user.Name.ToUpper())
                        uOrG.Name = user.LoginName;
                    secSiteOrList.UorGs.Add(uOrG);
                    foreach (SPRoleDefinition rd in ra.RoleDefinitionBindings)
                        uOrG.RoleNames.Add(rd.Name);
                    secSiteOrList.AtLeastOnePermission = true;
                }
            }
            if (user.IsSiteAdmin)
            {
                UorG uOrG = new UorG("Site Collection Admins", false);
                secSiteOrList.UorGs.Add(uOrG);
                uOrG.RoleNames.Add("Full Control");
                secSiteOrList.AtLeastOnePermission = true;
            }
            return secSiteOrList;

        }