Exemple #1
0
 private void HandleAccessControlEntriesChanged(AccessControlEntry ace)
 {
     if (ace != null)
     {
         ace.Index = AccessControlEntries.IndexOf(ace);
     }
 }
Exemple #2
0
        public AccessControlEntry CreateAccessControlEntry()
        {
            if (Class == null)
            {
                throw new InvalidOperationException("Cannot create AccessControlEntry if no SecurableClassDefinition is assigned to this AccessControlList.");
            }

            var accessControlEntry = AccessControlEntry.NewObject();

            foreach (var accessTypeDefinition in Class.AccessTypes)
            {
                accessControlEntry.AddAccessType(accessTypeDefinition);
            }
            accessControlEntry.AccessControlList = this;

            return(accessControlEntry);
        }
Exemple #3
0
        public bool IsEnabled(IEnumerationValueInfo value, IBusinessObject businessObject, IBusinessObjectEnumerationProperty property)
        {
            ArgumentUtility.CheckNotNull("value", value);
            ArgumentUtility.CheckNotNullAndType <AccessControlEntry> ("businessObject", businessObject);
            ArgumentUtility.CheckNotNull("property", property);

            AccessControlEntry ace = (AccessControlEntry)businessObject;
            bool isStateful        = ace.AccessControlList is StatefulAccessControlList;

            switch (property.Identifier)
            {
            case "TenantCondition":
                return(value.IsEnabled && IsTenantConditionEnabled((TenantCondition)value.Value, isStateful));

            case "GroupCondition":
                return(value.IsEnabled && IsGroupConditionEnabled((GroupCondition)value.Value, isStateful));

            case "UserCondition":
                return(value.IsEnabled && IsUserConditionEnabled((UserCondition)value.Value, isStateful));

            default:
                throw CreateInvalidOperationException("The property '{0}' is not supported by the '{1}'.", property.Identifier, typeof(AccessControlEntryPropertiesEnumerationValueFilter).FullName);
            }
        }
Exemple #4
0
    public static ObjectList<Permission> GetPermissionsForQuery (this AccessControlEntry ace)
    {
      ArgumentUtility.CheckNotNull ("ace", ace);

      return new ObjectList<Permission> (ace.GetPermissions());
    }