Ejemplo n.º 1
0
        private static void SetAccessLevel <T>(T accessLevel, IPropertyBag properties, string prefix)
        {
            MultiValuedProperty <string> multiValuedProperty = (MultiValuedProperty <string>)properties[OrganizationRelationshipSchema.FederationEnabledActions];
            string andRemoveAction = OrganizationRelationshipHelper.GetAndRemoveAction(multiValuedProperty, prefix);
            string targetElement   = OrganizationRelationshipHelper.GetTargetElement(andRemoveAction);

            multiValuedProperty.Add(OrganizationRelationshipHelper.GenerateAction(prefix, accessLevel.ToString(), targetElement));
        }
Ejemplo n.º 2
0
        private static void SetAccessScope <T>(ADObjectId objectId, IPropertyBag properties, string prefix, T defaultLevel)
        {
            MultiValuedProperty <string> multiValuedProperty = (MultiValuedProperty <string>)properties[OrganizationRelationshipSchema.FederationEnabledActions];
            string target          = (objectId != null) ? objectId.ObjectGuid.ToString() : null;
            string andRemoveAction = OrganizationRelationshipHelper.GetAndRemoveAction(multiValuedProperty, prefix);
            string text            = OrganizationRelationshipHelper.GetLevelElement(andRemoveAction);

            if (text == null)
            {
                text = defaultLevel.ToString();
            }
            multiValuedProperty.Add(OrganizationRelationshipHelper.GenerateAction(prefix, text, target));
        }