diff options
16 files changed, 442 insertions, 140 deletions
diff --git a/plugins/org.eclipse.emf.cdo.security.edit/plugin.properties b/plugins/org.eclipse.emf.cdo.security.edit/plugin.properties index aa3779cebf..0a78ace850 100644 --- a/plugins/org.eclipse.emf.cdo.security.edit/plugin.properties +++ b/plugins/org.eclipse.emf.cdo.security.edit/plugin.properties @@ -82,3 +82,6 @@ _UI_Realm_allGroups_feature = All Groups _UI_Realm_allRoles_feature = All Roles _UI_Realm_allChecks_feature = All Checks _UI_User_unassignedRoles_feature = Unassigned Roles +_UI_Realm_defaultPermission_feature = Default Permission +_UI_User_defaultPermissionOverride_feature = Default Permission Override +_UI_User_defaultPermission_feature = Default Permission diff --git a/plugins/org.eclipse.emf.cdo.security.edit/src/org/eclipse/emf/cdo/security/provider/RealmItemProvider.java b/plugins/org.eclipse.emf.cdo.security.edit/src/org/eclipse/emf/cdo/security/provider/RealmItemProvider.java index b75fc58340..4603773473 100644 --- a/plugins/org.eclipse.emf.cdo.security.edit/src/org/eclipse/emf/cdo/security/provider/RealmItemProvider.java +++ b/plugins/org.eclipse.emf.cdo.security.edit/src/org/eclipse/emf/cdo/security/provider/RealmItemProvider.java @@ -70,6 +70,7 @@ public class RealmItemProvider extends SecurityElementItemProvider implements IE super.getPropertyDescriptors(object); addNamePropertyDescriptor(object); + addDefaultPermissionPropertyDescriptor(object); } return itemPropertyDescriptors; } @@ -92,6 +93,23 @@ public class RealmItemProvider extends SecurityElementItemProvider implements IE } /** + * This adds a property descriptor for the Default Permission feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected void addDefaultPermissionPropertyDescriptor(Object object) + { + itemPropertyDescriptors.add(createItemPropertyDescriptor( + ((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_Realm_defaultPermission_feature"), //$NON-NLS-1$ + getString("_UI_PropertyDescriptor_description", "_UI_Realm_defaultPermission_feature", "_UI_Realm_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + SecurityPackage.Literals.REALM__DEFAULT_PERMISSION, true, false, false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + } + + /** * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}. @@ -176,6 +194,7 @@ public class RealmItemProvider extends SecurityElementItemProvider implements IE switch (notification.getFeatureID(Realm.class)) { case SecurityPackage.REALM__NAME: + case SecurityPackage.REALM__DEFAULT_PERMISSION: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); return; case SecurityPackage.REALM__ITEMS: diff --git a/plugins/org.eclipse.emf.cdo.security.edit/src/org/eclipse/emf/cdo/security/provider/UserItemProvider.java b/plugins/org.eclipse.emf.cdo.security.edit/src/org/eclipse/emf/cdo/security/provider/UserItemProvider.java index d66b443fea..b25747a028 100644 --- a/plugins/org.eclipse.emf.cdo.security.edit/src/org/eclipse/emf/cdo/security/provider/UserItemProvider.java +++ b/plugins/org.eclipse.emf.cdo.security.edit/src/org/eclipse/emf/cdo/security/provider/UserItemProvider.java @@ -74,6 +74,7 @@ public class UserItemProvider extends AssigneeItemProvider implements IEditingDo addFirstNamePropertyDescriptor(object); addLastNamePropertyDescriptor(object); addEmailPropertyDescriptor(object); + addDefaultPermissionOverridePropertyDescriptor(object); addLockedPropertyDescriptor(object); } return itemPropertyDescriptors; @@ -163,6 +164,23 @@ public class UserItemProvider extends AssigneeItemProvider implements IEditingDo } /** + * This adds a property descriptor for the Default Permission Override feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected void addDefaultPermissionOverridePropertyDescriptor(Object object) + { + itemPropertyDescriptors.add(createItemPropertyDescriptor( + ((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_User_defaultPermissionOverride_feature"), //$NON-NLS-1$ + getString("_UI_PropertyDescriptor_description", "_UI_User_defaultPermissionOverride_feature", "_UI_User_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + SecurityPackage.Literals.USER__DEFAULT_PERMISSION_OVERRIDE, true, false, false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + } + + /** * This adds a property descriptor for the Locked feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -267,6 +285,8 @@ public class UserItemProvider extends AssigneeItemProvider implements IEditingDo case SecurityPackage.USER__FIRST_NAME: case SecurityPackage.USER__LAST_NAME: case SecurityPackage.USER__EMAIL: + case SecurityPackage.USER__DEFAULT_PERMISSION_OVERRIDE: + case SecurityPackage.USER__DEFAULT_PERMISSION: case SecurityPackage.USER__LOCKED: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); return; diff --git a/plugins/org.eclipse.emf.cdo.security/model/security.ecore b/plugins/org.eclipse.emf.cdo.security/model/security.ecore index 7b95e9e7a7..fb055fac82 100644 --- a/plugins/org.eclipse.emf.cdo.security/model/security.ecore +++ b/plugins/org.eclipse.emf.cdo.security/model/security.ecore @@ -18,6 +18,7 @@ <eStructuralFeatures xsi:type="ecore:EReference" name="allChecks" upperBound="-1" eType="#//Check" changeable="false" volatile="true" transient="true" derived="true"/> <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EString"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="defaultPermission" eType="#//Permission"/> </eClassifiers> <eClassifiers xsi:type="ecore:EClass" name="Directory" eSuperTypes="#//SecurityItem"> <eStructuralFeatures xsi:type="ecore:EReference" name="items" upperBound="-1" @@ -64,6 +65,10 @@ <eStructuralFeatures xsi:type="ecore:EAttribute" name="firstName" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EString"/> <eStructuralFeatures xsi:type="ecore:EAttribute" name="lastName" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EString"/> <eStructuralFeatures xsi:type="ecore:EAttribute" name="email" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EString"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="defaultPermissionOverride" + eType="#//Permission"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="defaultPermission" eType="#//Permission" + changeable="false" volatile="true" transient="true" derived="true"/> <eStructuralFeatures xsi:type="ecore:EAttribute" name="locked" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EBoolean"/> <eStructuralFeatures xsi:type="ecore:EReference" name="password" eType="#//UserPassword" containment="true"/> @@ -74,8 +79,8 @@ <eClassifiers xsi:type="ecore:EClass" name="Check" abstract="true"> <eStructuralFeatures xsi:type="ecore:EReference" name="role" lowerBound="1" eType="#//Role" eOpposite="#//Role/checks"/> - <eStructuralFeatures xsi:type="ecore:EAttribute" name="permission" eType="#//Permission" - defaultValueLiteral="WRITE"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="permission" lowerBound="1" + eType="#//Permission" defaultValueLiteral="WRITE"/> </eClassifiers> <eClassifiers xsi:type="ecore:EClass" name="ClassCheck" eSuperTypes="#//Check"> <eStructuralFeatures xsi:type="ecore:EReference" name="classes" lowerBound="1" diff --git a/plugins/org.eclipse.emf.cdo.security/model/security.ecorediag b/plugins/org.eclipse.emf.cdo.security/model/security.ecorediag index 7720b96be6..dfd44d7737 100644 --- a/plugins/org.eclipse.emf.cdo.security/model/security.ecorediag +++ b/plugins/org.eclipse.emf.cdo.security/model/security.ecorediag @@ -18,7 +18,7 @@ </children> <styles xmi:type="notation:ShapeStyle" xmi:id="_BlvtcawpEeGqBf0LMO47dg" fontColor="4210752" fontName="Segoe UI" fontHeight="10" fillColor="13761016" lineColor="8421504"/> <element xmi:type="ecore:EClass" href="security.ecore#//SecurityElement"/> - <layoutConstraint xmi:type="notation:Bounds" xmi:id="_BlvtcqwpEeGqBf0LMO47dg" x="305" y="20"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_BlvtcqwpEeGqBf0LMO47dg" x="330" y="20"/> </children> <children xmi:type="notation:Node" xmi:id="_BlxioqwpEeGqBf0LMO47dg" type="1001"> <children xmi:type="notation:Node" xmi:id="_BlyJsKwpEeGqBf0LMO47dg" type="4001"/> @@ -34,7 +34,7 @@ </children> <styles xmi:type="notation:ShapeStyle" xmi:id="_Blxio6wpEeGqBf0LMO47dg" fontColor="4210752" fontName="Segoe UI" fontHeight="10" fillColor="13761016" lineColor="8421504"/> <element xmi:type="ecore:EClass" href="security.ecore#//SecurityItem"/> - <layoutConstraint xmi:type="notation:Bounds" xmi:id="_BlxipKwpEeGqBf0LMO47dg" x="211" y="136"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_BlxipKwpEeGqBf0LMO47dg" x="236" y="136"/> </children> <children xmi:type="notation:Node" xmi:id="_BlyJuawpEeGqBf0LMO47dg" type="1001"> <children xmi:type="notation:Node" xmi:id="_BlyJvKwpEeGqBf0LMO47dg" type="4001"/> @@ -54,7 +54,7 @@ </children> <styles xmi:type="notation:ShapeStyle" xmi:id="_BlyJuqwpEeGqBf0LMO47dg" fontColor="4210752" fontName="Segoe UI" fontHeight="10" fillColor="13761016" lineColor="8421504"/> <element xmi:type="ecore:EClass" href="security.ecore#//Realm"/> - <layoutConstraint xmi:type="notation:Bounds" xmi:id="_BlyJu6wpEeGqBf0LMO47dg" x="432" y="132"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_BlyJu6wpEeGqBf0LMO47dg" x="457" y="132"/> </children> <children xmi:type="notation:Node" xmi:id="_BlywyqwpEeGqBf0LMO47dg" type="1001"> <children xmi:type="notation:Node" xmi:id="_BlzX0KwpEeGqBf0LMO47dg" type="4001"/> @@ -74,7 +74,7 @@ </children> <styles xmi:type="notation:ShapeStyle" xmi:id="_Blywy6wpEeGqBf0LMO47dg" fontColor="4210752" fontName="Segoe UI" fontHeight="10" fillColor="13761016" lineColor="8421504"/> <element xmi:type="ecore:EClass" href="security.ecore#//Directory"/> - <layoutConstraint xmi:type="notation:Bounds" xmi:id="_BlywzKwpEeGqBf0LMO47dg" x="72" y="245"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_BlywzKwpEeGqBf0LMO47dg" x="97" y="245"/> </children> <children xmi:type="notation:Node" xmi:id="_BlzX26wpEeGqBf0LMO47dg" type="1001"> <children xmi:type="notation:Node" xmi:id="_Blz-4KwpEeGqBf0LMO47dg" type="4001"/> @@ -94,7 +94,7 @@ </children> <styles xmi:type="notation:ShapeStyle" xmi:id="_BlzX3KwpEeGqBf0LMO47dg" fontColor="4210752" fontName="Segoe UI" fontHeight="10" fillColor="13761016" lineColor="8421504"/> <element xmi:type="ecore:EClass" href="security.ecore#//Role"/> - <layoutConstraint xmi:type="notation:Bounds" xmi:id="_BlzX3awpEeGqBf0LMO47dg" x="439" y="245"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_BlzX3awpEeGqBf0LMO47dg" x="464" y="245"/> </children> <children xmi:type="notation:Node" xmi:id="_Bl0l8KwpEeGqBf0LMO47dg" type="1001"> <children xmi:type="notation:Node" xmi:id="_Bl0l86wpEeGqBf0LMO47dg" type="4001"/> @@ -114,7 +114,7 @@ </children> <styles xmi:type="notation:ShapeStyle" xmi:id="_Bl0l8awpEeGqBf0LMO47dg" fontColor="4210752" fontName="Segoe UI" fontHeight="10" fillColor="13761016" lineColor="8421504"/> <element xmi:type="ecore:EClass" href="security.ecore#//Assignee"/> - <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Bl0l8qwpEeGqBf0LMO47dg" x="211" y="245"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Bl0l8qwpEeGqBf0LMO47dg" x="236" y="245"/> </children> <children xmi:type="notation:Node" xmi:id="_Bl1NAqwpEeGqBf0LMO47dg" type="1001"> <children xmi:type="notation:Node" xmi:id="_Bl10EKwpEeGqBf0LMO47dg" type="4001"/> @@ -130,7 +130,7 @@ </children> <styles xmi:type="notation:ShapeStyle" xmi:id="_Bl1NA6wpEeGqBf0LMO47dg" fontColor="4210752" fontName="Segoe UI" fontHeight="10" fillColor="13761016" lineColor="8421504"/> <element xmi:type="ecore:EClass" href="security.ecore#//Group"/> - <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Bl1NBKwpEeGqBf0LMO47dg" x="325" y="373"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Bl1NBKwpEeGqBf0LMO47dg" x="380" y="373"/> </children> <children xmi:type="notation:Node" xmi:id="_Bl2bIKwpEeGqBf0LMO47dg" type="1001"> <children xmi:type="notation:Node" xmi:id="_Bl2bI6wpEeGqBf0LMO47dg" type="4001"/> @@ -166,7 +166,7 @@ </children> <styles xmi:type="notation:ShapeStyle" xmi:id="_Bl2bIawpEeGqBf0LMO47dg" fontColor="4210752" fontName="Segoe UI" fontHeight="10" fillColor="13761016" lineColor="8421504"/> <element xmi:type="ecore:EClass" href="security.ecore#//User"/> - <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Bl2bIqwpEeGqBf0LMO47dg" x="60" y="368"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Bl2bIqwpEeGqBf0LMO47dg" x="25" y="373"/> </children> <children xmi:type="notation:Node" xmi:id="_Bl3pQKwpEeGqBf0LMO47dg" type="1001"> <children xmi:type="notation:Node" xmi:id="_Bl3pQ6wpEeGqBf0LMO47dg" type="4001"/> @@ -186,7 +186,7 @@ </children> <styles xmi:type="notation:ShapeStyle" xmi:id="_Bl3pQawpEeGqBf0LMO47dg" fontColor="4210752" fontName="Segoe UI" fontHeight="10" fillColor="13761016" lineColor="8421504"/> <element xmi:type="ecore:EClass" href="security.ecore#//UserPassword"/> - <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Bl3pQqwpEeGqBf0LMO47dg" x="59" y="543"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Bl3pQqwpEeGqBf0LMO47dg" x="84" y="570"/> </children> <children xmi:type="notation:Node" xmi:id="_PWGq0LIPEeGyraMqKGwiUw" type="1001"> <children xmi:type="notation:Node" xmi:id="_PWKVMLIPEeGyraMqKGwiUw" type="4001"/> @@ -206,7 +206,7 @@ </children> <styles xmi:type="notation:ShapeStyle" xmi:id="_PWGq0bIPEeGyraMqKGwiUw" fontColor="4210752" fontName="Segoe UI" fontHeight="10" fillColor="13761016" lineColor="8421504"/> <element xmi:type="ecore:EClass" href="security.ecore#//Check"/> - <layoutConstraint xmi:type="notation:Bounds" xmi:id="_PWGq0rIPEeGyraMqKGwiUw" x="693" y="245" width="183"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_PWGq0rIPEeGyraMqKGwiUw" x="718" y="245" width="183"/> </children> <children xmi:type="notation:Node" xmi:id="_tvbkQLIQEeGyraMqKGwiUw" type="1001"> <children xmi:type="notation:Node" xmi:id="_tvdZcLIQEeGyraMqKGwiUw" type="4001"/> @@ -222,7 +222,7 @@ </children> <styles xmi:type="notation:ShapeStyle" xmi:id="_tvbkQbIQEeGyraMqKGwiUw" fontColor="4210752" fontName="Segoe UI" fontHeight="10" fillColor="13761016" lineColor="8421504"/> <element xmi:type="ecore:EClass" href="security.ecore#//ClassCheck"/> - <layoutConstraint xmi:type="notation:Bounds" xmi:id="_tvbkQrIQEeGyraMqKGwiUw" x="731" y="373" width="108"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_tvbkQrIQEeGyraMqKGwiUw" x="756" y="373" width="108"/> </children> <children xmi:type="notation:Node" xmi:id="_u_PmULIQEeGyraMqKGwiUw" type="1001"> <children xmi:type="notation:Node" xmi:id="_u_Q0cLIQEeGyraMqKGwiUw" type="4001"/> @@ -238,7 +238,7 @@ </children> <styles xmi:type="notation:ShapeStyle" xmi:id="_u_PmUbIQEeGyraMqKGwiUw" fontColor="4210752" fontName="Segoe UI" fontHeight="10" fillColor="13761016" lineColor="8421504"/> <element xmi:type="ecore:EClass" href="security.ecore#//PackageCheck"/> - <layoutConstraint xmi:type="notation:Bounds" xmi:id="_u_PmUrIQEeGyraMqKGwiUw" x="565" y="373" width="128"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_u_PmUrIQEeGyraMqKGwiUw" x="590" y="373" width="128"/> </children> <children xmi:type="notation:Node" xmi:id="_xW1v0LIQEeGyraMqKGwiUw" type="1001"> <children xmi:type="notation:Node" xmi:id="_xW298LIQEeGyraMqKGwiUw" type="4001"/> @@ -258,7 +258,7 @@ </children> <styles xmi:type="notation:ShapeStyle" xmi:id="_xW1v0bIQEeGyraMqKGwiUw" fontColor="4210752" fontName="Segoe UI" fontHeight="10" fillColor="13761016" lineColor="8421504"/> <element xmi:type="ecore:EClass" href="security.ecore#//ResourceCheck"/> - <layoutConstraint xmi:type="notation:Bounds" xmi:id="_xW1v0rIQEeGyraMqKGwiUw" x="875" y="373" width="134"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_xW1v0rIQEeGyraMqKGwiUw" x="900" y="373" width="134"/> </children> <children xmi:type="notation:Node" xmi:id="_Fl308LIREeGyraMqKGwiUw" type="1005"> <children xmi:type="notation:Node" xmi:id="_Fl64QLIREeGyraMqKGwiUw" type="4010"/> @@ -277,7 +277,7 @@ </children> <styles xmi:type="notation:ShapeStyle" xmi:id="_Fl4cALIREeGyraMqKGwiUw" fontColor="4210752" fontName="Segoe UI" fontHeight="10" fillColor="13761016" lineColor="8421504"/> <element xmi:type="ecore:EEnum" href="security.ecore#//Permission"/> - <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Fl4cAbIREeGyraMqKGwiUw" x="719" y="121" width="132"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Fl4cAbIREeGyraMqKGwiUw" x="744" y="136" width="132"/> </children> <children xmi:type="notation:Node" xmi:id="_x3ZpwLIREeGyraMqKGwiUw" type="1001"> <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_x4HbcLIREeGyraMqKGwiUw" source="Shortcut"> @@ -296,7 +296,7 @@ </children> <styles xmi:type="notation:ShapeStyle" xmi:id="_x3ZpwbIREeGyraMqKGwiUw" fontColor="4210752" fontName="Segoe UI" fontHeight="10" fillColor="13761016" lineColor="8421504"/> <element xmi:type="ecore:EClass" href="platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EClass"/> - <layoutConstraint xmi:type="notation:Bounds" xmi:id="_x3ZpwrIREeGyraMqKGwiUw" x="734" y="475"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_x3ZpwrIREeGyraMqKGwiUw" x="759" y="475"/> </children> <children xmi:type="notation:Node" xmi:id="_2OPHILIREeGyraMqKGwiUw" type="1001"> <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_2Om6kLIREeGyraMqKGwiUw" source="Shortcut"> @@ -315,7 +315,7 @@ </children> <styles xmi:type="notation:ShapeStyle" xmi:id="_2OPHIbIREeGyraMqKGwiUw" fontColor="4210752" fontName="Segoe UI" fontHeight="10" fillColor="13761016" lineColor="8421504"/> <element xmi:type="ecore:EClass" href="platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EPackage"/> - <layoutConstraint xmi:type="notation:Bounds" xmi:id="_2OPHIrIREeGyraMqKGwiUw" x="578" y="475"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_2OPHIrIREeGyraMqKGwiUw" x="603" y="475"/> </children> <styles xmi:type="notation:DiagramStyle" xmi:id="_BlsqIawpEeGqBf0LMO47dg"/> <element xmi:type="ecore:EPackage" href="security.ecore#/"/> @@ -323,7 +323,7 @@ <styles xmi:type="notation:ConnectorStyle" xmi:id="_Bl4QUawpEeGqBf0LMO47dg" routing="Rectilinear" lineColor="4210752"/> <styles xmi:type="notation:FontStyle" xmi:id="_Bl4QUqwpEeGqBf0LMO47dg" fontName="Segoe UI"/> <element xsi:nil="true"/> - <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_Bl4QU6wpEeGqBf0LMO47dg" points="[0, 0, -78, 57]$[0, -31, -78, 26]$[113, -31, 35, 26]$[113, -57, 35, 0]"/> + <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_Bl4QU6wpEeGqBf0LMO47dg" points="[0, 0, -78, 67]$[0, -38, -78, 29]$[113, -38, 35, 29]$[113, -67, 35, 0]"/> <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_Bm4V4awpEeGqBf0LMO47dg" id="(0.5,0.0)"/> <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_Bm4V4qwpEeGqBf0LMO47dg" id="(0.24647887323943662,1.0)"/> </edges> @@ -345,21 +345,21 @@ <styles xmi:type="notation:ConnectorStyle" xmi:id="_Bl43YawpEeGqBf0LMO47dg" routing="Rectilinear" lineColor="4210752"/> <styles xmi:type="notation:FontStyle" xmi:id="_Bl43YqwpEeGqBf0LMO47dg" fontName="Segoe UI"/> <element xsi:nil="true"/> - <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_Bl43Y6wpEeGqBf0LMO47dg" points="[0, 0, 113, 53]$[0, -27, 113, 26]$[-114, -27, -1, 26]$[-114, -53, -1, 0]"/> + <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_Bl43Y6wpEeGqBf0LMO47dg" points="[-15, 0, 144, 63]$[-15, -34, 144, 29]$[-160, -34, -1, 29]$[-160, -63, -1, 0]"/> <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_Bm8AQqwpEeGqBf0LMO47dg" id="(0.4956521739130435,0.0)"/> <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_Bm8AQ6wpEeGqBf0LMO47dg" id="(0.5,1.0)"/> </edges> <edges xmi:type="notation:Edge" xmi:id="_Bl43ZKwpEeGqBf0LMO47dg" type="3002" source="_BlywyqwpEeGqBf0LMO47dg" target="_BlxioqwpEeGqBf0LMO47dg"> <children xmi:type="notation:Node" xmi:id="_Bl5ecKwpEeGqBf0LMO47dg" type="4011"> - <layoutConstraint xmi:type="notation:Location" xmi:id="_Bl5ecawpEeGqBf0LMO47dg" x="20" y="-10"/> + <layoutConstraint xmi:type="notation:Location" xmi:id="_Bl5ecawpEeGqBf0LMO47dg" x="31" y="-12"/> </children> <children xmi:type="notation:Node" xmi:id="_Bl5ecqwpEeGqBf0LMO47dg" type="4012"> - <layoutConstraint xmi:type="notation:Location" xmi:id="_Bl5ec6wpEeGqBf0LMO47dg" x="26" y="10"/> + <layoutConstraint xmi:type="notation:Location" xmi:id="_Bl5ec6wpEeGqBf0LMO47dg" x="39" y="13"/> </children> <styles xmi:type="notation:ConnectorStyle" xmi:id="_Bl43ZawpEeGqBf0LMO47dg" routing="Rectilinear" lineColor="4210752"/> <styles xmi:type="notation:FontStyle" xmi:id="_Bl43ZqwpEeGqBf0LMO47dg" fontColor="4210752" fontName="Segoe UI" fontHeight="10"/> <element xmi:type="ecore:EReference" href="security.ecore#//Directory/items"/> - <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_Bl43Z6wpEeGqBf0LMO47dg" points="[-37, 25, -155, 93]$[-79, 25, -197, 93]$[-79, -85, -197, -17]$[102, -85, -16, -17]"/> + <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_Bl43Z6wpEeGqBf0LMO47dg" points="[-37, 25, -155, 93]$[-104, 25, -222, 93]$[-104, -85, -222, -17]$[102, -85, -16, -17]"/> <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_Bm488KwpEeGqBf0LMO47dg" id="(0.33043478260869563,0.0)"/> <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_Bm488awpEeGqBf0LMO47dg" id="(0.16666666666666666,1.0)"/> </edges> @@ -367,7 +367,7 @@ <styles xmi:type="notation:ConnectorStyle" xmi:id="_Bl6FgawpEeGqBf0LMO47dg" routing="Rectilinear" lineColor="4210752"/> <styles xmi:type="notation:FontStyle" xmi:id="_Bl6FgqwpEeGqBf0LMO47dg" fontName="Segoe UI"/> <element xsi:nil="true"/> - <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_Bl6Fg6wpEeGqBf0LMO47dg" points="[-18, 0, -116, 68]$[-18, -35, -116, 33]$[114, -35, 16, 33]$[114, -68, 16, 0]"/> + <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_Bl6Fg6wpEeGqBf0LMO47dg" points="[-18, 0, -116, 68]$[-18, -25, -116, 43]$[114, -25, 16, 43]$[114, -68, 16, 0]"/> <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_Bm488qwpEeGqBf0LMO47dg" id="(0.6608695652173913,0.0)"/> <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_Bm4886wpEeGqBf0LMO47dg" id="(0.3333333333333333,1.0)"/> </edges> @@ -389,7 +389,7 @@ <styles xmi:type="notation:ConnectorStyle" xmi:id="_Bl6skawpEeGqBf0LMO47dg" routing="Rectilinear" lineColor="4210752"/> <styles xmi:type="notation:FontStyle" xmi:id="_Bl6skqwpEeGqBf0LMO47dg" fontName="Segoe UI"/> <element xsi:nil="true"/> - <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_Bl6sk6wpEeGqBf0LMO47dg" points="[0, 0, 228, 68]$[0, -35, 228, 33]$[-229, -35, -1, 33]$[-229, -68, -1, 0]"/> + <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_Bl6sk6wpEeGqBf0LMO47dg" points="[0, 0, 228, 68]$[0, -25, 228, 43]$[-229, -25, -1, 43]$[-229, -68, -1, 0]"/> <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_Bm8nUKwpEeGqBf0LMO47dg" id="(0.5,0.0)"/> <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_Bm8nUawpEeGqBf0LMO47dg" id="(0.5,1.0)"/> </edges> @@ -453,15 +453,15 @@ <styles xmi:type="notation:ConnectorStyle" xmi:id="_Bl8hzawpEeGqBf0LMO47dg" routing="Rectilinear" lineColor="4210752"/> <styles xmi:type="notation:FontStyle" xmi:id="_Bl8hzqwpEeGqBf0LMO47dg" fontColor="4210752" fontName="Segoe UI" fontHeight="10"/> <element xmi:type="ecore:EReference" href="security.ecore#//Group/users"/> - <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_Bl8hz6wpEeGqBf0LMO47dg" points="[-50, -16, 196, 30]$[-177, -16, 69, 30]"/> - <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_2-SxIqwpEeGqBf0LMO47dg" id="(0.5,1.0)"/> - <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_2-SxI6wpEeGqBf0LMO47dg" id="(0.5,0.0)"/> + <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_Bl8hz6wpEeGqBf0LMO47dg" points="[-50, -17, 226, 24]$[-147, -17, 129, 24]"/> + <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_XAsWsLK5EeGvjoGgCEyXkw" id="(0.5,1.0)"/> + <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_XAsWsbK5EeGvjoGgCEyXkw" id="(0.5,0.0)"/> </edges> <edges xmi:type="notation:Edge" xmi:id="_Bl9I1KwpEeGqBf0LMO47dg" type="3003" source="_Bl1NAqwpEeGqBf0LMO47dg" target="_Bl0l8KwpEeGqBf0LMO47dg"> <styles xmi:type="notation:ConnectorStyle" xmi:id="_Bl9I1awpEeGqBf0LMO47dg" routing="Rectilinear" lineColor="4210752"/> <styles xmi:type="notation:FontStyle" xmi:id="_Bl9I1qwpEeGqBf0LMO47dg" fontName="Segoe UI"/> <element xsi:nil="true"/> - <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_Bl9I16wpEeGqBf0LMO47dg" points="[0, 0, 113, 79]$[0, -40, 113, 39]$[-115, -40, -2, 39]$[-115, -79, -2, 0]"/> + <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_Bl9I16wpEeGqBf0LMO47dg" points="[-10, 0, 133, 79]$[-10, -38, 133, 41]$[-135, -38, 8, 41]$[-135, -79, 8, 0]"/> <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_Bm9OYKwpEeGqBf0LMO47dg" id="(0.5,0.0)"/> <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_Bm9OYawpEeGqBf0LMO47dg" id="(0.5196078431372549,1.0)"/> </edges> @@ -475,7 +475,7 @@ <styles xmi:type="notation:ConnectorStyle" xmi:id="_Bl9I2awpEeGqBf0LMO47dg" routing="Rectilinear" lineColor="4210752"/> <styles xmi:type="notation:FontStyle" xmi:id="_Bl9I2qwpEeGqBf0LMO47dg" fontColor="4210752" fontName="Segoe UI" fontHeight="10"/> <element xmi:type="ecore:EReference" href="security.ecore#//User/groups"/> - <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_Bl9I26wpEeGqBf0LMO47dg" points="[69, 30, -177, -16]$[196, 30, -50, -16]"/> + <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_Bl9I26wpEeGqBf0LMO47dg" points="[129, 24, -147, -17]$[226, 24, -50, -17]"/> <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_Bm6yIawpEeGqBf0LMO47dg" id="(0.5,0.0)"/> <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_Bm6yIqwpEeGqBf0LMO47dg" id="(0.5,1.0)"/> </edges> @@ -489,7 +489,7 @@ <styles xmi:type="notation:ConnectorStyle" xmi:id="_Bl-W9awpEeGqBf0LMO47dg" routing="Rectilinear" lineColor="4210752"/> <styles xmi:type="notation:FontStyle" xmi:id="_Bl-W9qwpEeGqBf0LMO47dg" fontColor="4210752" fontName="Segoe UI" fontHeight="10"/> <element xmi:type="ecore:EReference" href="security.ecore#//User/password"/> - <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_Bl-W96wpEeGqBf0LMO47dg" points="[46, 117, 0, -107]$[46, 175, 0, -49]"/> + <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_Bl-W96wpEeGqBf0LMO47dg" points="[86, 151, 0, -95]$[86, 197, 0, -49]"/> <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_Bm6LEawpEeGqBf0LMO47dg" id="(0.16428571428571428,0.0)"/> <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_Bm6LEqwpEeGqBf0LMO47dg" id="(0.49645390070921985,1.0)"/> </edges> @@ -497,7 +497,7 @@ <styles xmi:type="notation:ConnectorStyle" xmi:id="_Bl-W_awpEeGqBf0LMO47dg" routing="Rectilinear" lineColor="4210752"/> <styles xmi:type="notation:FontStyle" xmi:id="_Bl-W_qwpEeGqBf0LMO47dg" fontName="Segoe UI"/> <element xsi:nil="true"/> - <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_Bl-W_6wpEeGqBf0LMO47dg" points="[-35, 0, -158, 74]$[-35, -35, -158, 39]$[97, -35, -26, 39]$[97, -74, -26, 0]"/> + <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_Bl-W_6wpEeGqBf0LMO47dg" points="[-45, 0, -138, 79]$[-45, -38, -138, 41]$[77, -38, -16, 41]$[77, -79, -16, 0]"/> <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_Bm9OYqwpEeGqBf0LMO47dg" id="(0.75,0.0)"/> <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_Bm9OY6wpEeGqBf0LMO47dg" id="(0.7549019607843137,1.0)"/> </edges> diff --git a/plugins/org.eclipse.emf.cdo.security/model/security.genmodel b/plugins/org.eclipse.emf.cdo.security/model/security.genmodel index 8f0fd751af..a13f5b7041 100644 --- a/plugins/org.eclipse.emf.cdo.security/model/security.genmodel +++ b/plugins/org.eclipse.emf.cdo.security/model/security.genmodel @@ -27,6 +27,7 @@ <genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference security.ecore#//Realm/allRoles"/> <genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference security.ecore#//Realm/allChecks"/> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute security.ecore#//Realm/name"/> + <genFeatures createChild="false" ecoreFeature="ecore:EAttribute security.ecore#//Realm/defaultPermission"/> </genClasses> <genClasses ecoreClass="security.ecore#//Directory"> <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference security.ecore#//Directory/items"/> @@ -34,8 +35,8 @@ </genClasses> <genClasses ecoreClass="security.ecore#//Role"> <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference security.ecore#//Role/assignees"/> - <genFeatures createChild="false" ecoreFeature="ecore:EAttribute security.ecore#//Role/id"/> <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference security.ecore#//Role/checks"/> + <genFeatures createChild="false" ecoreFeature="ecore:EAttribute security.ecore#//Role/id"/> </genClasses> <genClasses image="false" ecoreClass="security.ecore#//Assignee"> <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference security.ecore#//Assignee/roles"/> @@ -58,6 +59,8 @@ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute security.ecore#//User/firstName"/> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute security.ecore#//User/lastName"/> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute security.ecore#//User/email"/> + <genFeatures createChild="false" ecoreFeature="ecore:EAttribute security.ecore#//User/defaultPermissionOverride"/> + <genFeatures property="None" createChild="false" ecoreFeature="ecore:EAttribute security.ecore#//User/defaultPermission"/> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute security.ecore#//User/locked"/> <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference security.ecore#//User/password"/> </genClasses> diff --git a/plugins/org.eclipse.emf.cdo.security/src/org/eclipse/emf/cdo/security/Check.java b/plugins/org.eclipse.emf.cdo.security/src/org/eclipse/emf/cdo/security/Check.java index 8f7687077c..f905938725 100644 --- a/plugins/org.eclipse.emf.cdo.security/src/org/eclipse/emf/cdo/security/Check.java +++ b/plugins/org.eclipse.emf.cdo.security/src/org/eclipse/emf/cdo/security/Check.java @@ -69,7 +69,7 @@ public interface Check extends CDOObject * @see org.eclipse.emf.cdo.security.Permission * @see #setPermission(Permission) * @see org.eclipse.emf.cdo.security.SecurityPackage#getCheck_Permission() - * @model default="WRITE" + * @model default="WRITE" required="true" * @generated */ Permission getPermission(); diff --git a/plugins/org.eclipse.emf.cdo.security/src/org/eclipse/emf/cdo/security/Realm.java b/plugins/org.eclipse.emf.cdo.security/src/org/eclipse/emf/cdo/security/Realm.java index 005e6ece3c..51f3504dc4 100644 --- a/plugins/org.eclipse.emf.cdo.security/src/org/eclipse/emf/cdo/security/Realm.java +++ b/plugins/org.eclipse.emf.cdo.security/src/org/eclipse/emf/cdo/security/Realm.java @@ -26,6 +26,7 @@ import org.eclipse.emf.common.util.EList; * <li>{@link org.eclipse.emf.cdo.security.Realm#getAllRoles <em>All Roles</em>}</li> * <li>{@link org.eclipse.emf.cdo.security.Realm#getAllChecks <em>All Checks</em>}</li> * <li>{@link org.eclipse.emf.cdo.security.Realm#getName <em>Name</em>}</li> + * <li>{@link org.eclipse.emf.cdo.security.Realm#getDefaultPermission <em>Default Permission</em>}</li> * </ul> * </p> * @@ -141,4 +142,33 @@ public interface Realm extends SecurityElement */ void setName(String value); + /** + * Returns the value of the '<em><b>Default Permission</b></em>' attribute. + * The literals are from the enumeration {@link org.eclipse.emf.cdo.security.Permission}. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Default Permission</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Default Permission</em>' attribute. + * @see org.eclipse.emf.cdo.security.Permission + * @see #setDefaultPermission(Permission) + * @see org.eclipse.emf.cdo.security.SecurityPackage#getRealm_DefaultPermission() + * @model + * @generated + */ + Permission getDefaultPermission(); + + /** + * Sets the value of the '{@link org.eclipse.emf.cdo.security.Realm#getDefaultPermission <em>Default Permission</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Default Permission</em>' attribute. + * @see org.eclipse.emf.cdo.security.Permission + * @see #getDefaultPermission() + * @generated + */ + void setDefaultPermission(Permission value); + } // SecurityRealm diff --git a/plugins/org.eclipse.emf.cdo.security/src/org/eclipse/emf/cdo/security/SecurityPackage.java b/plugins/org.eclipse.emf.cdo.security/src/org/eclipse/emf/cdo/security/SecurityPackage.java index 65f44c2cb1..7fca6bc1b6 100644 --- a/plugins/org.eclipse.emf.cdo.security/src/org/eclipse/emf/cdo/security/SecurityPackage.java +++ b/plugins/org.eclipse.emf.cdo.security/src/org/eclipse/emf/cdo/security/SecurityPackage.java @@ -207,13 +207,22 @@ public interface SecurityPackage extends EPackage int REALM__NAME = SECURITY_ELEMENT_FEATURE_COUNT + 5; /** + * The feature id for the '<em><b>Default Permission</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int REALM__DEFAULT_PERMISSION = SECURITY_ELEMENT_FEATURE_COUNT + 6; + + /** * The number of structural features of the '<em>Realm</em>' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - int REALM_FEATURE_COUNT = SECURITY_ELEMENT_FEATURE_COUNT + 6; + int REALM_FEATURE_COUNT = SECURITY_ELEMENT_FEATURE_COUNT + 7; /** * The feature id for the '<em><b>Annotations</b></em>' containment reference list. @@ -562,13 +571,31 @@ public interface SecurityPackage extends EPackage int USER__EMAIL = ASSIGNEE_FEATURE_COUNT + 7; /** + * The feature id for the '<em><b>Default Permission Override</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int USER__DEFAULT_PERMISSION_OVERRIDE = ASSIGNEE_FEATURE_COUNT + 8; + + /** + * The feature id for the '<em><b>Default Permission</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int USER__DEFAULT_PERMISSION = ASSIGNEE_FEATURE_COUNT + 9; + + /** * The feature id for the '<em><b>Locked</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - int USER__LOCKED = ASSIGNEE_FEATURE_COUNT + 8; + int USER__LOCKED = ASSIGNEE_FEATURE_COUNT + 10; /** * The feature id for the '<em><b>Password</b></em>' containment reference. @@ -577,7 +604,7 @@ public interface SecurityPackage extends EPackage * @generated * @ordered */ - int USER__PASSWORD = ASSIGNEE_FEATURE_COUNT + 9; + int USER__PASSWORD = ASSIGNEE_FEATURE_COUNT + 11; /** * The number of structural features of the '<em>User</em>' class. @@ -586,7 +613,7 @@ public interface SecurityPackage extends EPackage * @generated * @ordered */ - int USER_FEATURE_COUNT = ASSIGNEE_FEATURE_COUNT + 10; + int USER_FEATURE_COUNT = ASSIGNEE_FEATURE_COUNT + 12; /** * The meta object id for the '{@link org.eclipse.emf.cdo.security.impl.UserPasswordImpl <em>User Password</em>}' class. @@ -888,6 +915,17 @@ public interface SecurityPackage extends EPackage EAttribute getRealm_Name(); /** + * Returns the meta object for the attribute '{@link org.eclipse.emf.cdo.security.Realm#getDefaultPermission <em>Default Permission</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>Default Permission</em>'. + * @see org.eclipse.emf.cdo.security.Realm#getDefaultPermission() + * @see #getRealm() + * @generated + */ + EAttribute getRealm_DefaultPermission(); + + /** * Returns the meta object for class '{@link org.eclipse.emf.cdo.security.Directory <em>Directory</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -1179,6 +1217,28 @@ public interface SecurityPackage extends EPackage EAttribute getUser_Email(); /** + * Returns the meta object for the attribute '{@link org.eclipse.emf.cdo.security.User#getDefaultPermissionOverride <em>Default Permission Override</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>Default Permission Override</em>'. + * @see org.eclipse.emf.cdo.security.User#getDefaultPermissionOverride() + * @see #getUser() + * @generated + */ + EAttribute getUser_DefaultPermissionOverride(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.emf.cdo.security.User#getDefaultPermission <em>Default Permission</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>Default Permission</em>'. + * @see org.eclipse.emf.cdo.security.User#getDefaultPermission() + * @see #getUser() + * @generated + */ + EAttribute getUser_DefaultPermission(); + + /** * Returns the meta object for the attribute '{@link org.eclipse.emf.cdo.security.User#isLocked <em>Locked</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -1418,6 +1478,14 @@ public interface SecurityPackage extends EPackage EAttribute REALM__NAME = eINSTANCE.getRealm_Name(); /** + * The meta object literal for the '<em><b>Default Permission</b></em>' attribute feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EAttribute REALM__DEFAULT_PERMISSION = eINSTANCE.getRealm_DefaultPermission(); + + /** * The meta object literal for the '{@link org.eclipse.emf.cdo.security.impl.DirectoryImpl <em>Directory</em>}' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -1646,6 +1714,22 @@ public interface SecurityPackage extends EPackage EAttribute USER__EMAIL = eINSTANCE.getUser_Email(); /** + * The meta object literal for the '<em><b>Default Permission Override</b></em>' attribute feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EAttribute USER__DEFAULT_PERMISSION_OVERRIDE = eINSTANCE.getUser_DefaultPermissionOverride(); + + /** + * The meta object literal for the '<em><b>Default Permission</b></em>' attribute feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EAttribute USER__DEFAULT_PERMISSION = eINSTANCE.getUser_DefaultPermission(); + + /** * The meta object literal for the '<em><b>Locked</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> diff --git a/plugins/org.eclipse.emf.cdo.security/src/org/eclipse/emf/cdo/security/User.java b/plugins/org.eclipse.emf.cdo.security/src/org/eclipse/emf/cdo/security/User.java index 937e5460dd..9ca84e7d18 100644 --- a/plugins/org.eclipse.emf.cdo.security/src/org/eclipse/emf/cdo/security/User.java +++ b/plugins/org.eclipse.emf.cdo.security/src/org/eclipse/emf/cdo/security/User.java @@ -28,6 +28,8 @@ import org.eclipse.emf.common.util.EList; * <li>{@link org.eclipse.emf.cdo.security.User#getFirstName <em>First Name</em>}</li> * <li>{@link org.eclipse.emf.cdo.security.User#getLastName <em>Last Name</em>}</li> * <li>{@link org.eclipse.emf.cdo.security.User#getEmail <em>Email</em>}</li> + * <li>{@link org.eclipse.emf.cdo.security.User#getDefaultPermissionOverride <em>Default Permission Override</em>}</li> + * <li>{@link org.eclipse.emf.cdo.security.User#getDefaultPermission <em>Default Permission</em>}</li> * <li>{@link org.eclipse.emf.cdo.security.User#isLocked <em>Locked</em>}</li> * <li>{@link org.eclipse.emf.cdo.security.User#getPassword <em>Password</em>}</li> * </ul> @@ -199,6 +201,52 @@ public interface User extends Assignee void setEmail(String value); /** + * Returns the value of the '<em><b>Default Permission Override</b></em>' attribute. + * The literals are from the enumeration {@link org.eclipse.emf.cdo.security.Permission}. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Default Permission Override</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Default Permission Override</em>' attribute. + * @see org.eclipse.emf.cdo.security.Permission + * @see #setDefaultPermissionOverride(Permission) + * @see org.eclipse.emf.cdo.security.SecurityPackage#getUser_DefaultPermissionOverride() + * @model + * @generated + */ + Permission getDefaultPermissionOverride(); + + /** + * Sets the value of the '{@link org.eclipse.emf.cdo.security.User#getDefaultPermissionOverride <em>Default Permission Override</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Default Permission Override</em>' attribute. + * @see org.eclipse.emf.cdo.security.Permission + * @see #getDefaultPermissionOverride() + * @generated + */ + void setDefaultPermissionOverride(Permission value); + + /** + * Returns the value of the '<em><b>Default Permission</b></em>' attribute. + * The literals are from the enumeration {@link org.eclipse.emf.cdo.security.Permission}. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Default Permission</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Default Permission</em>' attribute. + * @see org.eclipse.emf.cdo.security.Permission + * @see org.eclipse.emf.cdo.security.SecurityPackage#getUser_DefaultPermission() + * @model transient="true" changeable="false" volatile="true" derived="true" + * @generated + */ + Permission getDefaultPermission(); + + /** * Returns the value of the '<em><b>Locked</b></em>' attribute. * <!-- begin-user-doc --> * <p> diff --git a/plugins/org.eclipse.emf.cdo.security/src/org/eclipse/emf/cdo/security/impl/RealmImpl.java b/plugins/org.eclipse.emf.cdo.security/src/org/eclipse/emf/cdo/security/impl/RealmImpl.java index 433d19737a..fbd500f7c8 100644 --- a/plugins/org.eclipse.emf.cdo.security/src/org/eclipse/emf/cdo/security/impl/RealmImpl.java +++ b/plugins/org.eclipse.emf.cdo.security/src/org/eclipse/emf/cdo/security/impl/RealmImpl.java @@ -12,6 +12,7 @@ package org.eclipse.emf.cdo.security.impl; import org.eclipse.emf.cdo.security.Check; import org.eclipse.emf.cdo.security.Group; +import org.eclipse.emf.cdo.security.Permission; import org.eclipse.emf.cdo.security.Realm; import org.eclipse.emf.cdo.security.RealmUtil; import org.eclipse.emf.cdo.security.Role; @@ -37,6 +38,7 @@ import org.eclipse.emf.ecore.InternalEObject; * <li>{@link org.eclipse.emf.cdo.security.impl.RealmImpl#getAllRoles <em>All Roles</em>}</li> * <li>{@link org.eclipse.emf.cdo.security.impl.RealmImpl#getAllChecks <em>All Checks</em>}</li> * <li>{@link org.eclipse.emf.cdo.security.impl.RealmImpl#getName <em>Name</em>}</li> + * <li>{@link org.eclipse.emf.cdo.security.impl.RealmImpl#getDefaultPermission <em>Default Permission</em>}</li> * </ul> * </p> * @@ -224,6 +226,26 @@ public class RealmImpl extends SecurityElementImpl implements Realm eSet(SecurityPackage.Literals.REALM__NAME, newName); } + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public Permission getDefaultPermission() + { + return (Permission)eGet(SecurityPackage.Literals.REALM__DEFAULT_PERMISSION, true); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setDefaultPermission(Permission newDefaultPermission) + { + eSet(SecurityPackage.Literals.REALM__DEFAULT_PERMISSION, newDefaultPermission); + } + @Override public Realm getRealm() { diff --git a/plugins/org.eclipse.emf.cdo.security/src/org/eclipse/emf/cdo/security/impl/SecurityPackageImpl.java b/plugins/org.eclipse.emf.cdo.security/src/org/eclipse/emf/cdo/security/impl/SecurityPackageImpl.java index 57b914d158..a421c687fa 100644 --- a/plugins/org.eclipse.emf.cdo.security/src/org/eclipse/emf/cdo/security/impl/SecurityPackageImpl.java +++ b/plugins/org.eclipse.emf.cdo.security/src/org/eclipse/emf/cdo/security/impl/SecurityPackageImpl.java @@ -294,6 +294,16 @@ public class SecurityPackageImpl extends EPackageImpl implements SecurityPackage * <!-- end-user-doc --> * @generated */ + public EAttribute getRealm_DefaultPermission() + { + return (EAttribute)realmEClass.getEStructuralFeatures().get(6); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ public EClass getDirectory() { return directoryEClass; @@ -564,7 +574,7 @@ public class SecurityPackageImpl extends EPackageImpl implements SecurityPackage * <!-- end-user-doc --> * @generated */ - public EAttribute getUser_Locked() + public EAttribute getUser_DefaultPermissionOverride() { return (EAttribute)userEClass.getEStructuralFeatures().get(8); } @@ -574,9 +584,29 @@ public class SecurityPackageImpl extends EPackageImpl implements SecurityPackage * <!-- end-user-doc --> * @generated */ + public EAttribute getUser_DefaultPermission() + { + return (EAttribute)userEClass.getEStructuralFeatures().get(9); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EAttribute getUser_Locked() + { + return (EAttribute)userEClass.getEStructuralFeatures().get(10); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ public EReference getUser_Password() { - return (EReference)userEClass.getEStructuralFeatures().get(9); + return (EReference)userEClass.getEStructuralFeatures().get(11); } /** @@ -741,6 +771,7 @@ public class SecurityPackageImpl extends EPackageImpl implements SecurityPackage createEReference(realmEClass, REALM__ALL_ROLES); createEReference(realmEClass, REALM__ALL_CHECKS); createEAttribute(realmEClass, REALM__NAME); + createEAttribute(realmEClass, REALM__DEFAULT_PERMISSION); directoryEClass = createEClass(DIRECTORY); createEReference(directoryEClass, DIRECTORY__ITEMS); @@ -772,6 +803,8 @@ public class SecurityPackageImpl extends EPackageImpl implements SecurityPackage createEAttribute(userEClass, USER__FIRST_NAME); createEAttribute(userEClass, USER__LAST_NAME); createEAttribute(userEClass, USER__EMAIL); + createEAttribute(userEClass, USER__DEFAULT_PERMISSION_OVERRIDE); + createEAttribute(userEClass, USER__DEFAULT_PERMISSION); createEAttribute(userEClass, USER__LOCKED); createEReference(userEClass, USER__PASSWORD); @@ -880,6 +913,10 @@ public class SecurityPackageImpl extends EPackageImpl implements SecurityPackage getRealm_Name(), theEcorePackage.getEString(), "name", null, 0, 1, Realm.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ + initEAttribute( + getRealm_DefaultPermission(), + this.getPermission(), + "defaultPermission", null, 0, 1, Realm.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ initEClass(directoryEClass, Directory.class, "Directory", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ initEReference( @@ -989,6 +1026,14 @@ public class SecurityPackageImpl extends EPackageImpl implements SecurityPackage theEcorePackage.getEString(), "email", null, 0, 1, User.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ initEAttribute( + getUser_DefaultPermissionOverride(), + this.getPermission(), + "defaultPermissionOverride", null, 0, 1, User.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ + initEAttribute( + getUser_DefaultPermission(), + this.getPermission(), + "defaultPermission", null, 0, 1, User.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ + initEAttribute( getUser_Locked(), theEcorePackage.getEBoolean(), "locked", null, 0, 1, User.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ @@ -1014,7 +1059,7 @@ public class SecurityPackageImpl extends EPackageImpl implements SecurityPackage initEAttribute( getCheck_Permission(), this.getPermission(), - "permission", "WRITE", 0, 1, Check.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ //$NON-NLS-2$ + "permission", "WRITE", 1, 1, Check.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ //$NON-NLS-2$ initEClass(classCheckEClass, ClassCheck.class, "ClassCheck", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ diff --git a/plugins/org.eclipse.emf.cdo.security/src/org/eclipse/emf/cdo/security/impl/UserImpl.java b/plugins/org.eclipse.emf.cdo.security/src/org/eclipse/emf/cdo/security/impl/UserImpl.java index ce156c5a95..04b13c3677 100644 --- a/plugins/org.eclipse.emf.cdo.security/src/org/eclipse/emf/cdo/security/impl/UserImpl.java +++ b/plugins/org.eclipse.emf.cdo.security/src/org/eclipse/emf/cdo/security/impl/UserImpl.java @@ -11,6 +11,7 @@ package org.eclipse.emf.cdo.security.impl; import org.eclipse.emf.cdo.security.Group; +import org.eclipse.emf.cdo.security.Permission; import org.eclipse.emf.cdo.security.Realm; import org.eclipse.emf.cdo.security.Role; import org.eclipse.emf.cdo.security.SecurityPackage; @@ -40,6 +41,8 @@ import java.util.Set; * <li>{@link org.eclipse.emf.cdo.security.impl.UserImpl#getFirstName <em>First Name</em>}</li> * <li>{@link org.eclipse.emf.cdo.security.impl.UserImpl#getLastName <em>Last Name</em>}</li> * <li>{@link org.eclipse.emf.cdo.security.impl.UserImpl#getEmail <em>Email</em>}</li> + * <li>{@link org.eclipse.emf.cdo.security.impl.UserImpl#getDefaultPermissionOverride <em>Default Permission Override</em>}</li> + * <li>{@link org.eclipse.emf.cdo.security.impl.UserImpl#getDefaultPermission <em>Default Permission</em>}</li> * <li>{@link org.eclipse.emf.cdo.security.impl.UserImpl#isLocked <em>Locked</em>}</li> * <li>{@link org.eclipse.emf.cdo.security.impl.UserImpl#getPassword <em>Password</em>}</li> * </ul> @@ -274,6 +277,48 @@ public class UserImpl extends AssigneeImpl implements User * <!-- end-user-doc --> * @generated */ + public Permission getDefaultPermissionOverride() + { + return (Permission)eGet(SecurityPackage.Literals.USER__DEFAULT_PERMISSION_OVERRIDE, true); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setDefaultPermissionOverride(Permission newDefaultPermissionOverride) + { + eSet(SecurityPackage.Literals.USER__DEFAULT_PERMISSION_OVERRIDE, newDefaultPermissionOverride); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated NOT + */ + public Permission getDefaultPermission() + { + Permission defaultPermissionOverride = getDefaultPermissionOverride(); + if (defaultPermissionOverride != null) + { + return defaultPermissionOverride; + } + + Realm realm = getRealm(); + if (realm != null) + { + return realm.getDefaultPermission(); + } + + return null; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ public boolean isLocked() { return (Boolean)eGet(SecurityPackage.Literals.USER__LOCKED, true); diff --git a/plugins/org.eclipse.emf.cdo.server.security/src/org/eclipse/emf/cdo/server/internal/security/AnnotationRoleProvider.java b/plugins/org.eclipse.emf.cdo.server.security/src/org/eclipse/emf/cdo/server/internal/security/AnnotationRoleProvider.java index 5cce7c700a..ffb7d8c04e 100644 --- a/plugins/org.eclipse.emf.cdo.server.security/src/org/eclipse/emf/cdo/server/internal/security/AnnotationRoleProvider.java +++ b/plugins/org.eclipse.emf.cdo.server.security/src/org/eclipse/emf/cdo/server/internal/security/AnnotationRoleProvider.java @@ -17,6 +17,8 @@ import org.eclipse.emf.cdo.common.model.CDOPackageUnit; import org.eclipse.emf.cdo.common.revision.CDORevision; import org.eclipse.emf.cdo.common.revision.CDORevisionProvider; import org.eclipse.emf.cdo.common.security.CDOPermission; +import org.eclipse.emf.cdo.security.Realm; +import org.eclipse.emf.cdo.security.RealmUtil; import org.eclipse.emf.cdo.security.Role; import org.eclipse.emf.cdo.security.SecurityFactory; import org.eclipse.emf.cdo.security.SecurityItem; @@ -108,7 +110,7 @@ public class AnnotationRoleProvider implements IRoleProvider String token = tokenizer.nextToken(); if (token != null && token.length() != 0) { - Role role = securityManager.getRole(token); + Role role = getRole(securityManager.getRealm(), token); if (role == null) { role = SecurityFactory.eINSTANCE.createRole(); @@ -186,7 +188,7 @@ public class AnnotationRoleProvider implements IRoleProvider String token = tokenizer.nextToken(); if (token != null && token.length() != 0) { - Role role = securityManager.getRole(token); + Role role = getRole(securityManager.getRealm(), token); result.add(role); } } @@ -194,6 +196,18 @@ public class AnnotationRoleProvider implements IRoleProvider return result; } + private Role getRole(Realm realm, String roleID) + { + EList<SecurityItem> items = realm.getItems(); + Role role = RealmUtil.findRole(items, roleID); + if (role == null) + { + throw new SecurityException("Role " + roleID + " not found"); + } + + return role; + } + /** * @author Eike Stepper */ diff --git a/plugins/org.eclipse.emf.cdo.server.security/src/org/eclipse/emf/cdo/server/internal/security/SecurityManager.java b/plugins/org.eclipse.emf.cdo.server.security/src/org/eclipse/emf/cdo/server/internal/security/SecurityManager.java index b56b0e18e8..89f3da39a7 100644 --- a/plugins/org.eclipse.emf.cdo.server.security/src/org/eclipse/emf/cdo/server/internal/security/SecurityManager.java +++ b/plugins/org.eclipse.emf.cdo.server.security/src/org/eclipse/emf/cdo/server/internal/security/SecurityManager.java @@ -19,7 +19,6 @@ import org.eclipse.emf.cdo.net4j.CDONet4jSession; import org.eclipse.emf.cdo.net4j.CDONet4jSessionConfiguration; import org.eclipse.emf.cdo.net4j.CDONet4jUtil; import org.eclipse.emf.cdo.security.Check; -import org.eclipse.emf.cdo.security.Group; import org.eclipse.emf.cdo.security.Permission; import org.eclipse.emf.cdo.security.Realm; import org.eclipse.emf.cdo.security.RealmUtil; @@ -32,7 +31,6 @@ import org.eclipse.emf.cdo.server.IPermissionManager; import org.eclipse.emf.cdo.server.IRepository; import org.eclipse.emf.cdo.server.IStoreAccessor.CommitContext; import org.eclipse.emf.cdo.server.ITransaction; -import org.eclipse.emf.cdo.server.internal.security.bundle.OM; import org.eclipse.emf.cdo.server.security.ISecurityManager; import org.eclipse.emf.cdo.server.spi.security.IRoleProvider; import org.eclipse.emf.cdo.spi.common.revision.InternalCDORevision; @@ -60,12 +58,8 @@ import org.eclipse.net4j.util.security.SecurityUtil; import org.eclipse.emf.common.util.EList; import org.eclipse.emf.ecore.util.EcoreUtil; -import java.util.ArrayList; import java.util.HashMap; -import java.util.HashSet; -import java.util.List; import java.util.Map; -import java.util.Set; /** * @author Eike Stepper @@ -206,30 +200,6 @@ public class SecurityManager implements ISecurityManager } } - public Group getGroup(String groupID) - { - EList<SecurityItem> items = realm.getItems(); - Group group = RealmUtil.findGroup(items, groupID); - if (group == null) - { - throw new SecurityException("Group " + groupID + " not found"); - } - - return group; - } - - public Role getRole(String roleID) - { - EList<SecurityItem> items = realm.getItems(); - Role role = RealmUtil.findRole(items, roleID); - if (role == null) - { - throw new SecurityException("Role " + roleID + " not found"); - } - - return role; - } - public void modify(RealmOperation operation) { synchronized (transaction) @@ -252,7 +222,7 @@ public class SecurityManager implements ISecurityManager { CDOPermission result = CDOPermission.WRITE; - for (Role role : user.getUnassignedRoles()) + for (Role role : user.getRoles()) { for (Check check : role.getChecks()) { @@ -316,52 +286,52 @@ public class SecurityManager implements ISecurityManager return result; } - protected Set<Role> getNeededRoles(CDORevision revision, CDORevisionProvider revisionProvider, - CDOBranchPoint securityContext, CDOPermission permission) - { - Set<Role> result = null; - for (IRoleProvider roleProvider : getRoleProviders()) - { - try - { - Set<Role> roles = roleProvider.getRoles(this, securityContext, revisionProvider, revision, permission); - if (roles != null && !roles.isEmpty()) - { - if (result == null) - { - result = new HashSet<Role>(); - } - - result.addAll(roles); - } - } - catch (Exception ex) - { - OM.LOG.error(ex); - } - } - - return result; - } - - protected IRoleProvider[] getRoleProviders() - { - synchronized (containerListener) - { - if (roleProviders == null) - { - List<IRoleProvider> result = new ArrayList<IRoleProvider>(); - for (String factoryType : container.getFactoryTypes(IRoleProvider.Factory.PRODUCT_GROUP)) - { - result.add((IRoleProvider)container.getElement(IRoleProvider.Factory.PRODUCT_GROUP, factoryType, null)); - } - - roleProviders = result.toArray(new IRoleProvider[result.size()]); - } - } - - return roleProviders; - } + // protected Set<Role> getNeededRoles(CDORevision revision, CDORevisionProvider revisionProvider, + // CDOBranchPoint securityContext, CDOPermission permission) + // { + // Set<Role> result = null; + // for (IRoleProvider roleProvider : getRoleProviders()) + // { + // try + // { + // Set<Role> roles = roleProvider.getRoles(this, securityContext, revisionProvider, revision, permission); + // if (roles != null && !roles.isEmpty()) + // { + // if (result == null) + // { + // result = new HashSet<Role>(); + // } + // + // result.addAll(roles); + // } + // } + // catch (Exception ex) + // { + // OM.LOG.error(ex); + // } + // } + // + // return result; + // } + // + // protected IRoleProvider[] getRoleProviders() + // { + // synchronized (containerListener) + // { + // if (roleProviders == null) + // { + // List<IRoleProvider> result = new ArrayList<IRoleProvider>(); + // for (String factoryType : container.getFactoryTypes(IRoleProvider.Factory.PRODUCT_GROUP)) + // { + // result.add((IRoleProvider)container.getElement(IRoleProvider.Factory.PRODUCT_GROUP, factoryType, null)); + // } + // + // roleProviders = result.toArray(new IRoleProvider[result.size()]); + // } + // } + // + // return roleProviders; + // } /** * @author Eike Stepper @@ -449,17 +419,17 @@ public class SecurityManager implements ISecurityManager public void handleTransactionBeforeCommitting(ITransaction transaction, CommitContext commitContext, OMMonitor monitor) throws RuntimeException { - for (IRoleProvider roleProvider : getRoleProviders()) - { - try - { - roleProvider.handleCommit(SecurityManager.this, commitContext); - } - catch (Exception ex) - { - OM.LOG.error(ex); - } - } + // for (IRoleProvider roleProvider : getRoleProviders()) + // { + // try + // { + // roleProvider.handleCommit(SecurityManager.this, commitContext); + // } + // catch (Exception ex) + // { + // OM.LOG.error(ex); + // } + // } CDOBranchPoint securityContext = commitContext.getBranchPoint(); String userID = commitContext.getUserID(); diff --git a/plugins/org.eclipse.emf.cdo.server.security/src/org/eclipse/emf/cdo/server/security/ISecurityManager.java b/plugins/org.eclipse.emf.cdo.server.security/src/org/eclipse/emf/cdo/server/security/ISecurityManager.java index 4af1526bdb..878e11c0b4 100644 --- a/plugins/org.eclipse.emf.cdo.server.security/src/org/eclipse/emf/cdo/server/security/ISecurityManager.java +++ b/plugins/org.eclipse.emf.cdo.server.security/src/org/eclipse/emf/cdo/server/security/ISecurityManager.java @@ -10,9 +10,7 @@ */ package org.eclipse.emf.cdo.server.security; -import org.eclipse.emf.cdo.security.Group; import org.eclipse.emf.cdo.security.Realm; -import org.eclipse.emf.cdo.security.Role; import org.eclipse.emf.cdo.security.User; import org.eclipse.emf.cdo.server.IRepository; @@ -26,19 +24,15 @@ import org.eclipse.net4j.util.container.IManagedContainer; */ public interface ISecurityManager { + public IManagedContainer getContainer(); + public IRepository getRepository(); public String getRealmPath(); - public IManagedContainer getContainer(); - public Realm getRealm(); - public User getUser(String userID) throws SecurityException; - - public Group getGroup(String groupID) throws SecurityException; - - public Role getRole(String roleID) throws SecurityException; + public User getUser(String userID); public void modify(RealmOperation operation); |