Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2012-06-09 15:02:08 +0000
committerEike Stepper2012-06-09 15:02:08 +0000
commit9945d9f9085226e122ead08990c100790977866c (patch)
tree2a19ed9381f9c95e6de366eb28139367cd5177c6 /plugins/org.eclipse.emf.cdo.security
parent6f1faab6f60b6c691c05a5629ff89497906e10c9 (diff)
downloadcdo-9945d9f9085226e122ead08990c100790977866c.tar.gz
cdo-9945d9f9085226e122ead08990c100790977866c.tar.xz
cdo-9945d9f9085226e122ead08990c100790977866c.zip
[380629] Design a default Security model
https://bugs.eclipse.org/bugs/show_bug.cgi?id=380629
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.security')
-rw-r--r--plugins/org.eclipse.emf.cdo.security/model/security.ecore6
-rw-r--r--plugins/org.eclipse.emf.cdo.security/model/security.genmodel32
-rw-r--r--plugins/org.eclipse.emf.cdo.security/src/org/eclipse/emf/cdo/security/Group.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.security/src/org/eclipse/emf/cdo/security/SecurityPackage.java50
-rw-r--r--plugins/org.eclipse.emf.cdo.security/src/org/eclipse/emf/cdo/security/User.java17
-rw-r--r--plugins/org.eclipse.emf.cdo.security/src/org/eclipse/emf/cdo/security/impl/GroupImpl.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.security/src/org/eclipse/emf/cdo/security/impl/SecurityPackageImpl.java44
-rw-r--r--plugins/org.eclipse.emf.cdo.security/src/org/eclipse/emf/cdo/security/impl/UserImpl.java42
8 files changed, 164 insertions, 31 deletions
diff --git a/plugins/org.eclipse.emf.cdo.security/model/security.ecore b/plugins/org.eclipse.emf.cdo.security/model/security.ecore
index 7980d16ad9..683316931a 100644
--- a/plugins/org.eclipse.emf.cdo.security/model/security.ecore
+++ b/plugins/org.eclipse.emf.cdo.security/model/security.ecore
@@ -39,10 +39,10 @@
<eClassifiers xsi:type="ecore:EClass" name="Group" eSuperTypes="#//Assignee">
<eStructuralFeatures xsi:type="ecore:EReference" name="inheritedGroups" upperBound="-1"
eType="#//Group" eOpposite="#//Group/inheritingGroups"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="allInheritedGroups" upperBound="-1"
- eType="#//Group" changeable="false" volatile="true" transient="true" derived="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="inheritingGroups" upperBound="-1"
eType="#//Group" eOpposite="#//Group/inheritedGroups"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="allInheritedGroups" upperBound="-1"
+ eType="#//Group" changeable="false" volatile="true" transient="true" derived="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="allInheritingGroups" upperBound="-1"
eType="#//Group" changeable="false" volatile="true" transient="true" derived="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="allRoles" upperBound="-1"
@@ -57,6 +57,8 @@
eType="#//Group" changeable="false" volatile="true" transient="true" derived="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="allRoles" upperBound="-1"
eType="#//Role" changeable="false" volatile="true" transient="true" derived="true"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="unassignedRoles" upperBound="-1"
+ eType="#//Role" changeable="false" volatile="true" transient="true" derived="true"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="label" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EString"
changeable="false" volatile="true" transient="true" derived="true"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="firstName" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EString"/>
diff --git a/plugins/org.eclipse.emf.cdo.security/model/security.genmodel b/plugins/org.eclipse.emf.cdo.security/model/security.genmodel
index 70b371c761..8f0fd751af 100644
--- a/plugins/org.eclipse.emf.cdo.security/model/security.genmodel
+++ b/plugins/org.eclipse.emf.cdo.security/model/security.genmodel
@@ -12,12 +12,20 @@
<genPackages prefix="Security" basePackage="org.eclipse.emf.cdo" disposableProviderFactory="true"
multipleEditorPages="false" extensibleProviderFactory="true" childCreationExtenders="true"
ecorePackage="security.ecore#/">
+ <genEnums typeSafeEnumCompatible="false" ecoreEnum="security.ecore#//Permission">
+ <genEnumLiterals ecoreEnumLiteral="security.ecore#//Permission/READ"/>
+ <genEnumLiterals ecoreEnumLiteral="security.ecore#//Permission/WRITE"/>
+ </genEnums>
<genClasses image="false" ecoreClass="security.ecore#//SecurityElement">
<genOperations ecoreOperation="security.ecore#//SecurityElement/getRealm"/>
</genClasses>
<genClasses image="false" ecoreClass="security.ecore#//SecurityItem"/>
<genClasses ecoreClass="security.ecore#//Realm">
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference security.ecore#//Realm/items"/>
+ <genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference security.ecore#//Realm/allUsers"/>
+ <genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference security.ecore#//Realm/allGroups"/>
+ <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"/>
</genClasses>
<genClasses ecoreClass="security.ecore#//Directory">
@@ -27,19 +35,26 @@
<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 createChild="false" ecoreFeature="ecore:EAttribute security.ecore#//Role/type"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference security.ecore#//Role/checks"/>
</genClasses>
<genClasses image="false" ecoreClass="security.ecore#//Assignee">
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference security.ecore#//Assignee/roles"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute security.ecore#//Assignee/id"/>
</genClasses>
<genClasses ecoreClass="security.ecore#//Group">
- <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference security.ecore#//Group/users"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference security.ecore#//Group/inheritedGroups"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference security.ecore#//Group/inheritingGroups"/>
+ <genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference security.ecore#//Group/allInheritedGroups"/>
+ <genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference security.ecore#//Group/allInheritingGroups"/>
+ <genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference security.ecore#//Group/allRoles"/>
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference security.ecore#//Group/users"/>
</genClasses>
<genClasses ecoreClass="security.ecore#//User">
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference security.ecore#//User/groups"/>
+ <genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference security.ecore#//User/allGroups"/>
+ <genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference security.ecore#//User/allRoles"/>
+ <genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference security.ecore#//User/unassignedRoles"/>
+ <genFeatures property="Readonly" createChild="false" ecoreFeature="ecore:EAttribute security.ecore#//User/label"/>
<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"/>
@@ -49,5 +64,18 @@
<genClasses ecoreClass="security.ecore#//UserPassword">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute security.ecore#//UserPassword/encrypted"/>
</genClasses>
+ <genClasses image="false" ecoreClass="security.ecore#//Check">
+ <genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference security.ecore#//Check/role"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute security.ecore#//Check/permission"/>
+ </genClasses>
+ <genClasses ecoreClass="security.ecore#//ClassCheck">
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference security.ecore#//ClassCheck/classes"/>
+ </genClasses>
+ <genClasses ecoreClass="security.ecore#//PackageCheck">
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference security.ecore#//PackageCheck/packages"/>
+ </genClasses>
+ <genClasses ecoreClass="security.ecore#//ResourceCheck">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute security.ecore#//ResourceCheck/pattern"/>
+ </genClasses>
</genPackages>
</genmodel:GenModel>
diff --git a/plugins/org.eclipse.emf.cdo.security/src/org/eclipse/emf/cdo/security/Group.java b/plugins/org.eclipse.emf.cdo.security/src/org/eclipse/emf/cdo/security/Group.java
index 12f7a9acb9..b515261d3f 100644
--- a/plugins/org.eclipse.emf.cdo.security/src/org/eclipse/emf/cdo/security/Group.java
+++ b/plugins/org.eclipse.emf.cdo.security/src/org/eclipse/emf/cdo/security/Group.java
@@ -21,8 +21,8 @@ import org.eclipse.emf.common.util.EList;
* The following features are supported:
* <ul>
* <li>{@link org.eclipse.emf.cdo.security.Group#getInheritedGroups <em>Inherited Groups</em>}</li>
- * <li>{@link org.eclipse.emf.cdo.security.Group#getAllInheritedGroups <em>All Inherited Groups</em>}</li>
* <li>{@link org.eclipse.emf.cdo.security.Group#getInheritingGroups <em>Inheriting Groups</em>}</li>
+ * <li>{@link org.eclipse.emf.cdo.security.Group#getAllInheritedGroups <em>All Inherited Groups</em>}</li>
* <li>{@link org.eclipse.emf.cdo.security.Group#getAllInheritingGroups <em>All Inheriting Groups</em>}</li>
* <li>{@link org.eclipse.emf.cdo.security.Group#getAllRoles <em>All Roles</em>}</li>
* <li>{@link org.eclipse.emf.cdo.security.Group#getUsers <em>Users</em>}</li>
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 44bd901a24..d19b37af36 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
@@ -399,22 +399,22 @@ public interface SecurityPackage extends EPackage
int GROUP__INHERITED_GROUPS = ASSIGNEE_FEATURE_COUNT + 0;
/**
- * The feature id for the '<em><b>All Inherited Groups</b></em>' reference list.
+ * The feature id for the '<em><b>Inheriting Groups</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- int GROUP__ALL_INHERITED_GROUPS = ASSIGNEE_FEATURE_COUNT + 1;
+ int GROUP__INHERITING_GROUPS = ASSIGNEE_FEATURE_COUNT + 1;
/**
- * The feature id for the '<em><b>Inheriting Groups</b></em>' reference list.
+ * The feature id for the '<em><b>All Inherited Groups</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- int GROUP__INHERITING_GROUPS = ASSIGNEE_FEATURE_COUNT + 2;
+ int GROUP__ALL_INHERITED_GROUPS = ASSIGNEE_FEATURE_COUNT + 2;
/**
* The feature id for the '<em><b>All Inheriting Groups</b></em>' reference list.
@@ -517,13 +517,22 @@ public interface SecurityPackage extends EPackage
int USER__ALL_ROLES = ASSIGNEE_FEATURE_COUNT + 2;
/**
+ * The feature id for the '<em><b>Unassigned Roles</b></em>' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int USER__UNASSIGNED_ROLES = ASSIGNEE_FEATURE_COUNT + 3;
+
+ /**
* The feature id for the '<em><b>Label</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- int USER__LABEL = ASSIGNEE_FEATURE_COUNT + 3;
+ int USER__LABEL = ASSIGNEE_FEATURE_COUNT + 4;
/**
* The feature id for the '<em><b>First Name</b></em>' attribute.
@@ -532,7 +541,7 @@ public interface SecurityPackage extends EPackage
* @generated
* @ordered
*/
- int USER__FIRST_NAME = ASSIGNEE_FEATURE_COUNT + 4;
+ int USER__FIRST_NAME = ASSIGNEE_FEATURE_COUNT + 5;
/**
* The feature id for the '<em><b>Last Name</b></em>' attribute.
@@ -541,7 +550,7 @@ public interface SecurityPackage extends EPackage
* @generated
* @ordered
*/
- int USER__LAST_NAME = ASSIGNEE_FEATURE_COUNT + 5;
+ int USER__LAST_NAME = ASSIGNEE_FEATURE_COUNT + 6;
/**
* The feature id for the '<em><b>Email</b></em>' attribute.
@@ -550,7 +559,7 @@ public interface SecurityPackage extends EPackage
* @generated
* @ordered
*/
- int USER__EMAIL = ASSIGNEE_FEATURE_COUNT + 6;
+ int USER__EMAIL = ASSIGNEE_FEATURE_COUNT + 7;
/**
* The feature id for the '<em><b>Locked</b></em>' attribute.
@@ -559,7 +568,7 @@ public interface SecurityPackage extends EPackage
* @generated
* @ordered
*/
- int USER__LOCKED = ASSIGNEE_FEATURE_COUNT + 7;
+ int USER__LOCKED = ASSIGNEE_FEATURE_COUNT + 8;
/**
* The feature id for the '<em><b>Password</b></em>' containment reference.
@@ -568,7 +577,7 @@ public interface SecurityPackage extends EPackage
* @generated
* @ordered
*/
- int USER__PASSWORD = ASSIGNEE_FEATURE_COUNT + 8;
+ int USER__PASSWORD = ASSIGNEE_FEATURE_COUNT + 9;
/**
* The number of structural features of the '<em>User</em>' class.
@@ -577,7 +586,7 @@ public interface SecurityPackage extends EPackage
* @generated
* @ordered
*/
- int USER_FEATURE_COUNT = ASSIGNEE_FEATURE_COUNT + 9;
+ int USER_FEATURE_COUNT = ASSIGNEE_FEATURE_COUNT + 10;
/**
* The meta object id for the '{@link org.eclipse.emf.cdo.security.impl.UserPasswordImpl <em>User Password</em>}' class.
@@ -1115,6 +1124,17 @@ public interface SecurityPackage extends EPackage
EReference getUser_AllRoles();
/**
+ * Returns the meta object for the reference list '{@link org.eclipse.emf.cdo.security.User#getUnassignedRoles <em>Unassigned Roles</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference list '<em>Unassigned Roles</em>'.
+ * @see org.eclipse.emf.cdo.security.User#getUnassignedRoles()
+ * @see #getUser()
+ * @generated
+ */
+ EReference getUser_UnassignedRoles();
+
+ /**
* Returns the meta object for the attribute '{@link org.eclipse.emf.cdo.security.User#getLabel <em>Label</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -1586,6 +1606,14 @@ public interface SecurityPackage extends EPackage
EReference USER__ALL_ROLES = eINSTANCE.getUser_AllRoles();
/**
+ * The meta object literal for the '<em><b>Unassigned Roles</b></em>' reference list feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference USER__UNASSIGNED_ROLES = eINSTANCE.getUser_UnassignedRoles();
+
+ /**
* The meta object literal for the '<em><b>Label</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 08e9a95182..937e5460dd 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
@@ -23,6 +23,7 @@ import org.eclipse.emf.common.util.EList;
* <li>{@link org.eclipse.emf.cdo.security.User#getGroups <em>Groups</em>}</li>
* <li>{@link org.eclipse.emf.cdo.security.User#getAllGroups <em>All Groups</em>}</li>
* <li>{@link org.eclipse.emf.cdo.security.User#getAllRoles <em>All Roles</em>}</li>
+ * <li>{@link org.eclipse.emf.cdo.security.User#getUnassignedRoles <em>Unassigned Roles</em>}</li>
* <li>{@link org.eclipse.emf.cdo.security.User#getLabel <em>Label</em>}</li>
* <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>
@@ -89,6 +90,22 @@ public interface User extends Assignee
EList<Role> getAllRoles();
/**
+ * Returns the value of the '<em><b>Unassigned Roles</b></em>' reference list.
+ * The list contents are of type {@link org.eclipse.emf.cdo.security.Role}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Unassigned Roles</em>' reference list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Unassigned Roles</em>' reference list.
+ * @see org.eclipse.emf.cdo.security.SecurityPackage#getUser_UnassignedRoles()
+ * @model transient="true" changeable="false" volatile="true" derived="true"
+ * @generated
+ */
+ EList<Role> getUnassignedRoles();
+
+ /**
* Returns the value of the '<em><b>Label</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
diff --git a/plugins/org.eclipse.emf.cdo.security/src/org/eclipse/emf/cdo/security/impl/GroupImpl.java b/plugins/org.eclipse.emf.cdo.security/src/org/eclipse/emf/cdo/security/impl/GroupImpl.java
index 76c9259a40..6e133b49b8 100644
--- a/plugins/org.eclipse.emf.cdo.security/src/org/eclipse/emf/cdo/security/impl/GroupImpl.java
+++ b/plugins/org.eclipse.emf.cdo.security/src/org/eclipse/emf/cdo/security/impl/GroupImpl.java
@@ -30,8 +30,8 @@ import java.util.Set;
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.emf.cdo.security.impl.GroupImpl#getInheritedGroups <em>Inherited Groups</em>}</li>
- * <li>{@link org.eclipse.emf.cdo.security.impl.GroupImpl#getAllInheritedGroups <em>All Inherited Groups</em>}</li>
* <li>{@link org.eclipse.emf.cdo.security.impl.GroupImpl#getInheritingGroups <em>Inheriting Groups</em>}</li>
+ * <li>{@link org.eclipse.emf.cdo.security.impl.GroupImpl#getAllInheritedGroups <em>All Inherited Groups</em>}</li>
* <li>{@link org.eclipse.emf.cdo.security.impl.GroupImpl#getAllInheritingGroups <em>All Inheriting Groups</em>}</li>
* <li>{@link org.eclipse.emf.cdo.security.impl.GroupImpl#getAllRoles <em>All Roles</em>}</li>
* <li>{@link org.eclipse.emf.cdo.security.impl.GroupImpl#getUsers <em>Users</em>}</li>
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 44d5687591..a2016d7ca5 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
@@ -436,7 +436,7 @@ public class SecurityPackageImpl extends EPackageImpl implements SecurityPackage
*/
public EReference getGroup_InheritingGroups()
{
- return (EReference)groupEClass.getEStructuralFeatures().get(2);
+ return (EReference)groupEClass.getEStructuralFeatures().get(1);
}
/**
@@ -456,7 +456,7 @@ public class SecurityPackageImpl extends EPackageImpl implements SecurityPackage
*/
public EReference getGroup_AllInheritedGroups()
{
- return (EReference)groupEClass.getEStructuralFeatures().get(1);
+ return (EReference)groupEClass.getEStructuralFeatures().get(2);
}
/**
@@ -514,9 +514,19 @@ public class SecurityPackageImpl extends EPackageImpl implements SecurityPackage
* <!-- end-user-doc -->
* @generated
*/
+ public EReference getUser_UnassignedRoles()
+ {
+ return (EReference)userEClass.getEStructuralFeatures().get(3);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
public EAttribute getUser_Label()
{
- return (EAttribute)userEClass.getEStructuralFeatures().get(3);
+ return (EAttribute)userEClass.getEStructuralFeatures().get(4);
}
/**
@@ -526,7 +536,7 @@ public class SecurityPackageImpl extends EPackageImpl implements SecurityPackage
*/
public EAttribute getUser_FirstName()
{
- return (EAttribute)userEClass.getEStructuralFeatures().get(4);
+ return (EAttribute)userEClass.getEStructuralFeatures().get(5);
}
/**
@@ -536,7 +546,7 @@ public class SecurityPackageImpl extends EPackageImpl implements SecurityPackage
*/
public EAttribute getUser_LastName()
{
- return (EAttribute)userEClass.getEStructuralFeatures().get(5);
+ return (EAttribute)userEClass.getEStructuralFeatures().get(6);
}
/**
@@ -546,7 +556,7 @@ public class SecurityPackageImpl extends EPackageImpl implements SecurityPackage
*/
public EAttribute getUser_Email()
{
- return (EAttribute)userEClass.getEStructuralFeatures().get(6);
+ return (EAttribute)userEClass.getEStructuralFeatures().get(7);
}
/**
@@ -556,7 +566,7 @@ public class SecurityPackageImpl extends EPackageImpl implements SecurityPackage
*/
public EAttribute getUser_Locked()
{
- return (EAttribute)userEClass.getEStructuralFeatures().get(7);
+ return (EAttribute)userEClass.getEStructuralFeatures().get(8);
}
/**
@@ -566,7 +576,7 @@ public class SecurityPackageImpl extends EPackageImpl implements SecurityPackage
*/
public EReference getUser_Password()
{
- return (EReference)userEClass.getEStructuralFeatures().get(8);
+ return (EReference)userEClass.getEStructuralFeatures().get(9);
}
/**
@@ -747,8 +757,8 @@ public class SecurityPackageImpl extends EPackageImpl implements SecurityPackage
groupEClass = createEClass(GROUP);
createEReference(groupEClass, GROUP__INHERITED_GROUPS);
- createEReference(groupEClass, GROUP__ALL_INHERITED_GROUPS);
createEReference(groupEClass, GROUP__INHERITING_GROUPS);
+ createEReference(groupEClass, GROUP__ALL_INHERITED_GROUPS);
createEReference(groupEClass, GROUP__ALL_INHERITING_GROUPS);
createEReference(groupEClass, GROUP__ALL_ROLES);
createEReference(groupEClass, GROUP__USERS);
@@ -757,6 +767,7 @@ public class SecurityPackageImpl extends EPackageImpl implements SecurityPackage
createEReference(userEClass, USER__GROUPS);
createEReference(userEClass, USER__ALL_GROUPS);
createEReference(userEClass, USER__ALL_ROLES);
+ createEReference(userEClass, USER__UNASSIGNED_ROLES);
createEAttribute(userEClass, USER__LABEL);
createEAttribute(userEClass, USER__FIRST_NAME);
createEAttribute(userEClass, USER__LAST_NAME);
@@ -915,16 +926,16 @@ public class SecurityPackageImpl extends EPackageImpl implements SecurityPackage
this.getGroup_InheritingGroups(),
"inheritedGroups", null, 0, -1, Group.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
initEReference(
- getGroup_AllInheritedGroups(),
- this.getGroup(),
- null,
- "allInheritedGroups", null, 0, -1, Group.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
- initEReference(
getGroup_InheritingGroups(),
this.getGroup(),
this.getGroup_InheritedGroups(),
"inheritingGroups", null, 0, -1, Group.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
initEReference(
+ getGroup_AllInheritedGroups(),
+ this.getGroup(),
+ null,
+ "allInheritedGroups", null, 0, -1, Group.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
+ initEReference(
getGroup_AllInheritingGroups(),
this.getGroup(),
null,
@@ -956,6 +967,11 @@ public class SecurityPackageImpl extends EPackageImpl implements SecurityPackage
this.getRole(),
null,
"allRoles", null, 0, -1, User.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
+ initEReference(
+ getUser_UnassignedRoles(),
+ this.getRole(),
+ null,
+ "unassignedRoles", null, 0, -1, User.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
initEAttribute(
getUser_Label(),
theEcorePackage.getEString(),
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 b89ea6527d..ce156c5a95 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.Realm;
import org.eclipse.emf.cdo.security.Role;
import org.eclipse.emf.cdo.security.SecurityPackage;
import org.eclipse.emf.cdo.security.User;
@@ -34,6 +35,7 @@ import java.util.Set;
* <li>{@link org.eclipse.emf.cdo.security.impl.UserImpl#getGroups <em>Groups</em>}</li>
* <li>{@link org.eclipse.emf.cdo.security.impl.UserImpl#getAllGroups <em>All Groups</em>}</li>
* <li>{@link org.eclipse.emf.cdo.security.impl.UserImpl#getAllRoles <em>All Roles</em>}</li>
+ * <li>{@link org.eclipse.emf.cdo.security.impl.UserImpl#getUnassignedRoles <em>Unassigned Roles</em>}</li>
* <li>{@link org.eclipse.emf.cdo.security.impl.UserImpl#getLabel <em>Label</em>}</li>
* <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>
@@ -105,6 +107,36 @@ public class UserImpl extends AssigneeImpl implements User
}
};
+ private EList<Role> unassignedRoles = new CachedList<Role>()
+ {
+ @Override
+ protected InternalEObject getOwner()
+ {
+ return UserImpl.this;
+ }
+
+ @Override
+ protected EStructuralFeature getFeature()
+ {
+ return SecurityPackage.Literals.USER__UNASSIGNED_ROLES;
+ }
+
+ @Override
+ protected Object[] getData()
+ {
+ Set<Role> result = new HashSet<Role>();
+
+ Realm realm = getRealm();
+ if (realm != null)
+ {
+ result.addAll(realm.getAllRoles());
+ result.removeAll(getAllRoles());
+ }
+
+ return result.toArray();
+ }
+ };
+
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -160,6 +192,16 @@ public class UserImpl extends AssigneeImpl implements User
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public EList<Role> getUnassignedRoles()
+ {
+ return unassignedRoles;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @generated
*/
public String getLabel()

Back to the top