private bool IsSafeToRemoveDisableAssignmentFromGroup(ExchangeRoleAssignment roleAssignment)
        {
            if (!RoleAssignmentsGlobalConstraints.IsValidCannedRoleToGroupAssignment(roleAssignment))
            {
                return(true);
            }
            ExchangeRole role = this.GetRole(roleAssignment.Role);

            if (!role.IsValid)
            {
                return(true);
            }
            bool flag = true;
            bool verifyGroupEmptiness = false;

            if (roleAssignment.RoleAssignmentDelegationType.Equals(RoleAssignmentDelegationType.DelegatingOrgWide) && role.IsRootRole && !role.IsUnscoped)
            {
                flag = false;
            }
            if (roleAssignment.RoleAssignmentDelegationType.Equals(RoleAssignmentDelegationType.Regular) && role.IsRootRole && RoleAssignmentsGlobalConstraints.RoleTypesWithRegularAssignment.Contains(role.RoleType))
            {
                flag = false;
                verifyGroupEmptiness = true;
            }
            flag = (flag || !role.GetImplicitScopeSet().Equals(roleAssignment.GetSimpleScopeSet()));
            if (!flag)
            {
                flag = this.ExistDistinctRoleAssignmentForGroup(roleAssignment, role, verifyGroupEmptiness);
            }
            return(flag);
        }
        private bool IsUserRequiredForAssignment(ExchangeRoleAssignment roleAssignment)
        {
            if (!RoleAssignmentsGlobalConstraints.IsValidCannedRoleToGroupAssignment(roleAssignment))
            {
                return(false);
            }
            ExchangeRole role = this.GetRole(roleAssignment.Role);

            return(role.IsValid && (roleAssignment.RoleAssignmentDelegationType.Equals(RoleAssignmentDelegationType.Regular) && role.IsRootRole && RoleAssignmentsGlobalConstraints.RoleTypesWithRegularAssignment.Contains(role.RoleType)) && role.GetImplicitScopeSet().Equals(roleAssignment.GetSimpleScopeSet()));
        }