Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2012-05-28 08:32:03 +0000
committerEike Stepper2012-05-28 08:32:03 +0000
commitddc6120a7f9db25f5991e5f0bf2db600482b4cad (patch)
treec9858b1d1dd7f887d2caaa90cd0e91d5b3b555c4 /plugins/org.eclipse.emf.cdo.security.edit
parent1ef49aa5c994733ec662249f9a417020d6f28b01 (diff)
downloadcdo-ddc6120a7f9db25f5991e5f0bf2db600482b4cad.tar.gz
cdo-ddc6120a7f9db25f5991e5f0bf2db600482b4cad.tar.xz
cdo-ddc6120a7f9db25f5991e5f0bf2db600482b4cad.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.edit')
-rw-r--r--plugins/org.eclipse.emf.cdo.security.edit/plugin.properties6
-rw-r--r--plugins/org.eclipse.emf.cdo.security.edit/src/org/eclipse/emf/cdo/security/provider/GroupItemProvider.java48
-rw-r--r--plugins/org.eclipse.emf.cdo.security.edit/src/org/eclipse/emf/cdo/security/provider/SecurityItemProviderAdapterFactory.java16
-rw-r--r--plugins/org.eclipse.emf.cdo.security.edit/src/org/eclipse/emf/cdo/security/provider/UserItemProvider.java51
4 files changed, 107 insertions, 14 deletions
diff --git a/plugins/org.eclipse.emf.cdo.security.edit/plugin.properties b/plugins/org.eclipse.emf.cdo.security.edit/plugin.properties
index beaad9d7aa..ffc4ef785c 100644
--- a/plugins/org.eclipse.emf.cdo.security.edit/plugin.properties
+++ b/plugins/org.eclipse.emf.cdo.security.edit/plugin.properties
@@ -59,3 +59,9 @@ _UI_Group_inheritingGroups_feature = Inheriting Groups
_UI_Directory_type = Directory
_UI_Directory_items_feature = Items
_UI_Directory_name_feature = Name
+_UI_Group_allInheritedGroups_feature = All Inherited Groups
+_UI_Group_allRoles_feature = All Roles
+_UI_User_allGroups_feature = All Groups
+_UI_User_allRoles_feature = All Roles
+_UI_User_label_feature = Label
+_UI_Group_allInheritingGroups_feature = All Inheriting Groups
diff --git a/plugins/org.eclipse.emf.cdo.security.edit/src/org/eclipse/emf/cdo/security/provider/GroupItemProvider.java b/plugins/org.eclipse.emf.cdo.security.edit/src/org/eclipse/emf/cdo/security/provider/GroupItemProvider.java
index aee28b3b49..236bb331a7 100644
--- a/plugins/org.eclipse.emf.cdo.security.edit/src/org/eclipse/emf/cdo/security/provider/GroupItemProvider.java
+++ b/plugins/org.eclipse.emf.cdo.security.edit/src/org/eclipse/emf/cdo/security/provider/GroupItemProvider.java
@@ -66,7 +66,10 @@ public class GroupItemProvider extends AssigneeItemProvider implements IEditingD
super.getPropertyDescriptors(object);
addInheritedGroupsPropertyDescriptor(object);
+ addAllInheritedGroupsPropertyDescriptor(object);
addInheritingGroupsPropertyDescriptor(object);
+ addAllInheritingGroupsPropertyDescriptor(object);
+ addAllRolesPropertyDescriptor(object);
addUsersPropertyDescriptor(object);
}
return itemPropertyDescriptors;
@@ -118,6 +121,51 @@ public class GroupItemProvider extends AssigneeItemProvider implements IEditingD
}
/**
+ * This adds a property descriptor for the All Inheriting Groups feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addAllInheritingGroupsPropertyDescriptor(Object object)
+ {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Group_allInheritingGroups_feature"), //$NON-NLS-1$
+ getString("_UI_PropertyDescriptor_description", "_UI_Group_allInheritingGroups_feature", "_UI_Group_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ SecurityPackage.Literals.GROUP__ALL_INHERITING_GROUPS, false, false, false, null, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the All Inherited Groups feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addAllInheritedGroupsPropertyDescriptor(Object object)
+ {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Group_allInheritedGroups_feature"), //$NON-NLS-1$
+ getString("_UI_PropertyDescriptor_description", "_UI_Group_allInheritedGroups_feature", "_UI_Group_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ SecurityPackage.Literals.GROUP__ALL_INHERITED_GROUPS, false, false, false, null, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the All Roles feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addAllRolesPropertyDescriptor(Object object)
+ {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Group_allRoles_feature"), //$NON-NLS-1$
+ getString("_UI_PropertyDescriptor_description", "_UI_Group_allRoles_feature", "_UI_Group_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ SecurityPackage.Literals.GROUP__ALL_ROLES, false, false, false, null, null, null));
+ }
+
+ /**
* This returns Group.gif.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
diff --git a/plugins/org.eclipse.emf.cdo.security.edit/src/org/eclipse/emf/cdo/security/provider/SecurityItemProviderAdapterFactory.java b/plugins/org.eclipse.emf.cdo.security.edit/src/org/eclipse/emf/cdo/security/provider/SecurityItemProviderAdapterFactory.java
index 36f9559850..26b612adbb 100644
--- a/plugins/org.eclipse.emf.cdo.security.edit/src/org/eclipse/emf/cdo/security/provider/SecurityItemProviderAdapterFactory.java
+++ b/plugins/org.eclipse.emf.cdo.security.edit/src/org/eclipse/emf/cdo/security/provider/SecurityItemProviderAdapterFactory.java
@@ -312,7 +312,7 @@ public class SecurityItemProviderAdapterFactory extends SecurityAdapterFactory i
if (isFactoryForType(type))
{
Object adapter = super.adapt(object, type);
- if (!(type instanceof Class<?>) || ((Class<?>)type).isInstance(adapter))
+ if (!(type instanceof Class<?>) || (((Class<?>)type).isInstance(adapter)))
{
return adapter;
}
@@ -390,7 +390,7 @@ public class SecurityItemProviderAdapterFactory extends SecurityAdapterFactory i
}
/**
- * This disposes all of the item providers created by this factory.
+ * This disposes all of the item providers created by this factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
@@ -398,29 +398,17 @@ public class SecurityItemProviderAdapterFactory extends SecurityAdapterFactory i
public void dispose()
{
if (realmItemProvider != null)
- {
realmItemProvider.dispose();
- }
if (directoryItemProvider != null)
- {
directoryItemProvider.dispose();
- }
if (roleItemProvider != null)
- {
roleItemProvider.dispose();
- }
if (groupItemProvider != null)
- {
groupItemProvider.dispose();
- }
if (userItemProvider != null)
- {
userItemProvider.dispose();
- }
if (userPasswordItemProvider != null)
- {
userPasswordItemProvider.dispose();
- }
}
}
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 9dd8e137b9..68b2b2c70a 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
@@ -70,6 +70,9 @@ public class UserItemProvider extends AssigneeItemProvider implements IEditingDo
super.getPropertyDescriptors(object);
addGroupsPropertyDescriptor(object);
+ addAllGroupsPropertyDescriptor(object);
+ addAllRolesPropertyDescriptor(object);
+ addLabelPropertyDescriptor(object);
addFirstNamePropertyDescriptor(object);
addLastNamePropertyDescriptor(object);
addEmailPropertyDescriptor(object);
@@ -94,6 +97,53 @@ public class UserItemProvider extends AssigneeItemProvider implements IEditingDo
}
/**
+ * This adds a property descriptor for the All Groups feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addAllGroupsPropertyDescriptor(Object object)
+ {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_User_allGroups_feature"), //$NON-NLS-1$
+ getString("_UI_PropertyDescriptor_description", "_UI_User_allGroups_feature", "_UI_User_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ SecurityPackage.Literals.USER__ALL_GROUPS, false, false, false, null, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the All Roles feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addAllRolesPropertyDescriptor(Object object)
+ {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_User_allRoles_feature"), //$NON-NLS-1$
+ getString("_UI_PropertyDescriptor_description", "_UI_User_allRoles_feature", "_UI_User_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ SecurityPackage.Literals.USER__ALL_ROLES, false, false, false, null, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Label feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addLabelPropertyDescriptor(Object object)
+ {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_User_label_feature"), //$NON-NLS-1$
+ getString("_UI_PropertyDescriptor_description", "_UI_User_label_feature", "_UI_User_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ SecurityPackage.Literals.USER__LABEL, false, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null,
+ null));
+ }
+
+ /**
* This adds a property descriptor for the First Name feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -245,6 +295,7 @@ public class UserItemProvider extends AssigneeItemProvider implements IEditingDo
switch (notification.getFeatureID(User.class))
{
+ case SecurityPackage.USER__LABEL:
case SecurityPackage.USER__FIRST_NAME:
case SecurityPackage.USER__LAST_NAME:
case SecurityPackage.USER__EMAIL:

Back to the top