private void HandleAccessControlEntriesChanged(AccessControlEntry ace) { if (ace != null) { ace.Index = AccessControlEntries.IndexOf(ace); } }
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); }
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); } }
public static ObjectList<Permission> GetPermissionsForQuery (this AccessControlEntry ace) { ArgumentUtility.CheckNotNull ("ace", ace); return new ObjectList<Permission> (ace.GetPermissions()); }