Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2012-06-10 11:46:52 +0000
committerEike Stepper2012-06-10 11:46:52 +0000
commitdf6fed9b304081a943db6c3ed20e376d5f890548 (patch)
treeb40ed51124b524bf33c072d4a4bb8026b854ea16 /plugins/org.eclipse.emf.cdo.security.edit/src
parent18397e5d7cee96d44b4972fe6f032b589a323a38 (diff)
downloadcdo-df6fed9b304081a943db6c3ed20e376d5f890548.tar.gz
cdo-df6fed9b304081a943db6c3ed20e376d5f890548.tar.xz
cdo-df6fed9b304081a943db6c3ed20e376d5f890548.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/src')
-rw-r--r--plugins/org.eclipse.emf.cdo.security.edit/src/org/eclipse/emf/cdo/security/provider/AssigneeItemProvider.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.security.edit/src/org/eclipse/emf/cdo/security/provider/ClassCheckItemProvider.java30
-rw-r--r--plugins/org.eclipse.emf.cdo.security.edit/src/org/eclipse/emf/cdo/security/provider/DirectoryItemProvider.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.security.edit/src/org/eclipse/emf/cdo/security/provider/GroupItemProvider.java6
-rw-r--r--plugins/org.eclipse.emf.cdo.security.edit/src/org/eclipse/emf/cdo/security/provider/PackageCheckItemProvider.java18
-rw-r--r--plugins/org.eclipse.emf.cdo.security.edit/src/org/eclipse/emf/cdo/security/provider/RealmItemProvider.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.security.edit/src/org/eclipse/emf/cdo/security/provider/RoleItemProvider.java6
-rw-r--r--plugins/org.eclipse.emf.cdo.security.edit/src/org/eclipse/emf/cdo/security/provider/UserItemProvider.java6
-rw-r--r--plugins/org.eclipse.emf.cdo.security.edit/src/org/eclipse/emf/cdo/security/provider/UserPasswordItemProvider.java26
9 files changed, 46 insertions, 56 deletions
diff --git a/plugins/org.eclipse.emf.cdo.security.edit/src/org/eclipse/emf/cdo/security/provider/AssigneeItemProvider.java b/plugins/org.eclipse.emf.cdo.security.edit/src/org/eclipse/emf/cdo/security/provider/AssigneeItemProvider.java
index 194ee7fc5c..fdd0837fad 100644
--- a/plugins/org.eclipse.emf.cdo.security.edit/src/org/eclipse/emf/cdo/security/provider/AssigneeItemProvider.java
+++ b/plugins/org.eclipse.emf.cdo.security.edit/src/org/eclipse/emf/cdo/security/provider/AssigneeItemProvider.java
@@ -67,8 +67,8 @@ public class AssigneeItemProvider extends SecurityItemItemProvider implements IE
{
super.getPropertyDescriptors(object);
- addRolesPropertyDescriptor(object);
addIdPropertyDescriptor(object);
+ addRolesPropertyDescriptor(object);
}
return itemPropertyDescriptors;
}
diff --git a/plugins/org.eclipse.emf.cdo.security.edit/src/org/eclipse/emf/cdo/security/provider/ClassCheckItemProvider.java b/plugins/org.eclipse.emf.cdo.security.edit/src/org/eclipse/emf/cdo/security/provider/ClassCheckItemProvider.java
index 2631c29fc4..e793a2a4fc 100644
--- a/plugins/org.eclipse.emf.cdo.security.edit/src/org/eclipse/emf/cdo/security/provider/ClassCheckItemProvider.java
+++ b/plugins/org.eclipse.emf.cdo.security.edit/src/org/eclipse/emf/cdo/security/provider/ClassCheckItemProvider.java
@@ -8,6 +8,7 @@ import org.eclipse.emf.cdo.security.SecurityPackage;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemColorProvider;
@@ -58,24 +59,26 @@ public class ClassCheckItemProvider extends CheckItemProvider implements IEditin
{
super.getPropertyDescriptors(object);
- addClassesPropertyDescriptor(object);
+ addApplicableClassPropertyDescriptor(object);
}
return itemPropertyDescriptors;
}
/**
- * This adds a property descriptor for the Classes feature.
+ * This adds a property descriptor for the Applicable Class feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
- protected void addClassesPropertyDescriptor(Object object)
+ protected void addApplicableClassPropertyDescriptor(Object object)
{
- itemPropertyDescriptors.add(createItemPropertyDescriptor(
- ((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(),
- getString("_UI_ClassCheck_classes_feature"), //$NON-NLS-1$
- getString("_UI_PropertyDescriptor_description", "_UI_ClassCheck_classes_feature", "_UI_ClassCheck_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- SecurityPackage.Literals.CLASS_CHECK__CLASSES, true, false, true, null, null, null));
+ itemPropertyDescriptors
+ .add(createItemPropertyDescriptor(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_ClassCheck_applicableClass_feature"), //$NON-NLS-1$
+ getString(
+ "_UI_PropertyDescriptor_description", "_UI_ClassCheck_applicableClass_feature", "_UI_ClassCheck_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ SecurityPackage.Literals.CLASS_CHECK__APPLICABLE_CLASS, true, false, true, null, null, null));
}
/**
@@ -105,15 +108,22 @@ public class ClassCheckItemProvider extends CheckItemProvider implements IEditin
* This returns the label text for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @generated
+ * @generated NOT
*/
@Override
public String getText(Object object)
{
Permission labelValue = ((ClassCheck)object).getPermission();
+ EClass applicableClass = ((ClassCheck)object).getApplicableClass();
String label = labelValue == null ? null : labelValue.toString();
+
+ if (applicableClass != null)
+ {
+ label += " " + applicableClass.getName();
+ }
+
return label == null || label.length() == 0 ? getString("_UI_ClassCheck_type") : //$NON-NLS-1$
- getString("_UI_ClassCheck_type") + " " + label; //$NON-NLS-1$ //$NON-NLS-2$
+ label;
}
/**
diff --git a/plugins/org.eclipse.emf.cdo.security.edit/src/org/eclipse/emf/cdo/security/provider/DirectoryItemProvider.java b/plugins/org.eclipse.emf.cdo.security.edit/src/org/eclipse/emf/cdo/security/provider/DirectoryItemProvider.java
index 26b6761698..6295b195ba 100644
--- a/plugins/org.eclipse.emf.cdo.security.edit/src/org/eclipse/emf/cdo/security/provider/DirectoryItemProvider.java
+++ b/plugins/org.eclipse.emf.cdo.security.edit/src/org/eclipse/emf/cdo/security/provider/DirectoryItemProvider.java
@@ -151,14 +151,14 @@ public class DirectoryItemProvider extends SecurityItemItemProvider implements I
* This returns the label text for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @generated
+ * @generated NOT
*/
@Override
public String getText(Object object)
{
String label = ((Directory)object).getName();
return label == null || label.length() == 0 ? getString("_UI_Directory_type") : //$NON-NLS-1$
- getString("_UI_Directory_type") + " " + label; //$NON-NLS-1$ //$NON-NLS-2$
+ label;
}
/**
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..5261d0a65b 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
@@ -65,9 +65,9 @@ public class GroupItemProvider extends AssigneeItemProvider implements IEditingD
{
super.getPropertyDescriptors(object);
+ addUsersPropertyDescriptor(object);
addInheritedGroupsPropertyDescriptor(object);
addInheritingGroupsPropertyDescriptor(object);
- addUsersPropertyDescriptor(object);
}
return itemPropertyDescriptors;
}
@@ -144,14 +144,14 @@ public class GroupItemProvider extends AssigneeItemProvider implements IEditingD
* This returns the label text for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @generated
+ * @generated NOT
*/
@Override
public String getText(Object object)
{
String label = ((Group)object).getId();
return label == null || label.length() == 0 ? getString("_UI_Group_type") : //$NON-NLS-1$
- getString("_UI_Group_type") + " " + label; //$NON-NLS-1$ //$NON-NLS-2$
+ label;
}
/**
diff --git a/plugins/org.eclipse.emf.cdo.security.edit/src/org/eclipse/emf/cdo/security/provider/PackageCheckItemProvider.java b/plugins/org.eclipse.emf.cdo.security.edit/src/org/eclipse/emf/cdo/security/provider/PackageCheckItemProvider.java
index 61d97265a0..5d4848d765 100644
--- a/plugins/org.eclipse.emf.cdo.security.edit/src/org/eclipse/emf/cdo/security/provider/PackageCheckItemProvider.java
+++ b/plugins/org.eclipse.emf.cdo.security.edit/src/org/eclipse/emf/cdo/security/provider/PackageCheckItemProvider.java
@@ -58,24 +58,26 @@ public class PackageCheckItemProvider extends CheckItemProvider implements IEdit
{
super.getPropertyDescriptors(object);
- addPackagesPropertyDescriptor(object);
+ addApplicablePackagePropertyDescriptor(object);
}
return itemPropertyDescriptors;
}
/**
- * This adds a property descriptor for the Packages feature.
+ * This adds a property descriptor for the Applicable Package feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
- protected void addPackagesPropertyDescriptor(Object object)
+ protected void addApplicablePackagePropertyDescriptor(Object object)
{
- itemPropertyDescriptors.add(createItemPropertyDescriptor(
- ((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(),
- getString("_UI_PackageCheck_packages_feature"), //$NON-NLS-1$
- getString("_UI_PropertyDescriptor_description", "_UI_PackageCheck_packages_feature", "_UI_PackageCheck_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- SecurityPackage.Literals.PACKAGE_CHECK__PACKAGES, true, false, true, null, null, null));
+ itemPropertyDescriptors
+ .add(createItemPropertyDescriptor(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_PackageCheck_applicablePackage_feature"), //$NON-NLS-1$
+ getString(
+ "_UI_PropertyDescriptor_description", "_UI_PackageCheck_applicablePackage_feature", "_UI_PackageCheck_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ SecurityPackage.Literals.PACKAGE_CHECK__APPLICABLE_PACKAGE, true, false, true, null, null, null));
}
/**
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 4603773473..50cb93d207 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
@@ -169,14 +169,14 @@ public class RealmItemProvider extends SecurityElementItemProvider implements IE
* This returns the label text for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @generated
+ * @generated NOT
*/
@Override
public String getText(Object object)
{
String label = ((Realm)object).getName();
return label == null || label.length() == 0 ? getString("_UI_Realm_type") : //$NON-NLS-1$
- getString("_UI_Realm_type") + " " + label; //$NON-NLS-1$ //$NON-NLS-2$
+ label;
}
/**
diff --git a/plugins/org.eclipse.emf.cdo.security.edit/src/org/eclipse/emf/cdo/security/provider/RoleItemProvider.java b/plugins/org.eclipse.emf.cdo.security.edit/src/org/eclipse/emf/cdo/security/provider/RoleItemProvider.java
index ddcdae5f79..fc456262b5 100644
--- a/plugins/org.eclipse.emf.cdo.security.edit/src/org/eclipse/emf/cdo/security/provider/RoleItemProvider.java
+++ b/plugins/org.eclipse.emf.cdo.security.edit/src/org/eclipse/emf/cdo/security/provider/RoleItemProvider.java
@@ -69,8 +69,8 @@ public class RoleItemProvider extends SecurityItemItemProvider implements IEditi
{
super.getPropertyDescriptors(object);
- addAssigneesPropertyDescriptor(object);
addIdPropertyDescriptor(object);
+ addAssigneesPropertyDescriptor(object);
}
return itemPropertyDescriptors;
}
@@ -165,14 +165,14 @@ public class RoleItemProvider extends SecurityItemItemProvider implements IEditi
* This returns the label text for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @generated
+ * @generated NOT
*/
@Override
public String getText(Object object)
{
String label = ((Role)object).getId();
return label == null || label.length() == 0 ? getString("_UI_Role_type") : //$NON-NLS-1$
- getString("_UI_Role_type") + " " + label; //$NON-NLS-1$ //$NON-NLS-2$
+ label;
}
/**
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 b25747a028..349a508a8d 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
@@ -69,13 +69,13 @@ public class UserItemProvider extends AssigneeItemProvider implements IEditingDo
{
super.getPropertyDescriptors(object);
- addGroupsPropertyDescriptor(object);
addLabelPropertyDescriptor(object);
addFirstNamePropertyDescriptor(object);
addLastNamePropertyDescriptor(object);
addEmailPropertyDescriptor(object);
addDefaultPermissionOverridePropertyDescriptor(object);
addLockedPropertyDescriptor(object);
+ addGroupsPropertyDescriptor(object);
}
return itemPropertyDescriptors;
}
@@ -257,14 +257,14 @@ public class UserItemProvider extends AssigneeItemProvider implements IEditingDo
* This returns the label text for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @generated
+ * @generated NOT
*/
@Override
public String getText(Object object)
{
String label = ((User)object).getId();
return label == null || label.length() == 0 ? getString("_UI_User_type") : //$NON-NLS-1$
- getString("_UI_User_type") + " " + label; //$NON-NLS-1$ //$NON-NLS-2$
+ label;
}
/**
diff --git a/plugins/org.eclipse.emf.cdo.security.edit/src/org/eclipse/emf/cdo/security/provider/UserPasswordItemProvider.java b/plugins/org.eclipse.emf.cdo.security.edit/src/org/eclipse/emf/cdo/security/provider/UserPasswordItemProvider.java
index ad0ec6be20..a5df9a5ea1 100644
--- a/plugins/org.eclipse.emf.cdo.security.edit/src/org/eclipse/emf/cdo/security/provider/UserPasswordItemProvider.java
+++ b/plugins/org.eclipse.emf.cdo.security.edit/src/org/eclipse/emf/cdo/security/provider/UserPasswordItemProvider.java
@@ -16,7 +16,6 @@ import org.eclipse.emf.cdo.security.UserPassword;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.util.ResourceLocator;
-import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.IChildCreationExtender;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemColorProvider;
@@ -29,7 +28,6 @@ import org.eclipse.emf.edit.provider.ITableItemColorProvider;
import org.eclipse.emf.edit.provider.ITableItemFontProvider;
import org.eclipse.emf.edit.provider.ITableItemLabelProvider;
import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
-import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.ItemProviderAdapter;
import org.eclipse.emf.edit.provider.ViewerNotification;
@@ -70,29 +68,11 @@ public class UserPasswordItemProvider extends ItemProviderAdapter implements IEd
{
super.getPropertyDescriptors(object);
- addEncryptedPropertyDescriptor(object);
}
return itemPropertyDescriptors;
}
/**
- * This adds a property descriptor for the Encrypted feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected void addEncryptedPropertyDescriptor(Object object)
- {
- itemPropertyDescriptors.add(createItemPropertyDescriptor(
- ((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
- getResourceLocator(),
- getString("_UI_UserPassword_encrypted_feature"), //$NON-NLS-1$
- getString("_UI_PropertyDescriptor_description", "_UI_UserPassword_encrypted_feature", "_UI_UserPassword_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- SecurityPackage.Literals.USER_PASSWORD__ENCRYPTED, true, false, false,
- ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
- }
-
- /**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
@@ -130,14 +110,12 @@ public class UserPasswordItemProvider extends ItemProviderAdapter implements IEd
* This returns the label text for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @generated
+ * @generated NOT
*/
@Override
public String getText(Object object)
{
- String label = ((UserPassword)object).getEncrypted();
- return label == null || label.length() == 0 ? getString("_UI_UserPassword_type") : //$NON-NLS-1$
- getString("_UI_UserPassword_type") + " " + label; //$NON-NLS-1$ //$NON-NLS-2$
+ return getString("_UI_UserPassword_type"); //$NON-NLS-1$
}
/**

Back to the top