modules/core/domain/src/main/java/org/rhq/core/domain/authz/Permission.java
| 72 ++--------
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/PermissionsItem.java
| 38 ++---
2 files changed, 39 insertions(+), 71 deletions(-)
New commits:
commit e23fb5d0b2972dfafa9bb69ff58f9391a88ffcf9
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Sun Nov 21 20:11:19 2010 -0500
add description to each of the permissions on the role edit view (still need to i18n
them); remove displayName and description fields from the Permission entity
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/authz/Permission.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/authz/Permission.java
index 6156cd4..4ccaa80 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/authz/Permission.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/authz/Permission.java
@@ -23,6 +23,7 @@
package org.rhq.core.domain.authz;
import java.util.HashSet;
+import java.util.Set;
import org.rhq.core.domain.auth.Subject;
@@ -40,99 +41,86 @@ public enum Permission {
/**
* can C/U/D users and roles (viewing is implied for everyone)
*/
- MANAGE_SECURITY(Target.GLOBAL, "Manage Security", "can C/U/D users and
roles (viewing is implied for everyone)"), // 0
+ MANAGE_SECURITY(Target.GLOBAL), // 0
/**
* can C/R/U/D all resources, groups and can import auto-discovered resources
*/
- MANAGE_INVENTORY(Target.GLOBAL, "Manage Inventory",
- "can C/R/U/D all resources, groups and can import auto-discovered
resources"), // 1
+ MANAGE_INVENTORY(Target.GLOBAL), // 1
/**
* can modify the RHQ Server configuration and perform any server-related
functionality
*/
- MANAGE_SETTINGS(Target.GLOBAL, "Manage Settings",
- "can modify the RHQ Server configuration and perform any server-related
functionality"), // 2
+ MANAGE_SETTINGS(Target.GLOBAL), // 2
+
/* ========= Resource Permissions ========= */
/**
* can view (but not C/U/D) all aspects of this Resource except its configuration
({@link #CONFIGURE_READ} is
* required to view that); this permission is implied just by having a Resource or
Group in one's assigned Roles
*/
- VIEW_RESOURCE(
- Target.RESOURCE,
- "View Resource",
- "can view (but not C/U/D) all aspects of this Resource except its
configuration (CONFIGURE_READ is"
- + "required to view that); this permission is implied just by having a
Resource or Group in one's assigned Roles"), // 3
+ VIEW_RESOURCE(Target.RESOURCE), // 3
/**
* can modify resource name, description, and plugin config (e.g. set
principal/credentials jboss-as plugin uses to
* access the managed JBossAS instance)
*/
- MODIFY_RESOURCE(Target.RESOURCE, "Modify Resource",
- "can modify resource name, description, and plugin config (e.g. set
principal/credentials jboss-as plugin uses "
- + "to access the managed JBossAS instance)"), // 4
+ MODIFY_RESOURCE(Target.RESOURCE), // 4
/**
* can delete this resource (which also implies deleting all its descendant
resources)
*/
- DELETE_RESOURCE(Target.RESOURCE, "Delete Resource",
- "can delete this resource (which also implies deleting all its descendant
resources)"), // 5
+ DELETE_RESOURCE(Target.RESOURCE), // 5
/**
* can manually create new child servers or services
*/
- CREATE_CHILD_RESOURCES(Target.RESOURCE, "Create Child Resource",
- "can manually create new child servers or services"), // 6
+ CREATE_CHILD_RESOURCES(Target.RESOURCE), // 6
/**
* can C/U/D alert definitions (this implies {@link #MANAGE_MEASUREMENTS} and {@link
#CONTROL})
*/
- MANAGE_ALERTS(Target.RESOURCE, "Manage Alerts",
- "can C/U/D alert definitions (this implies MANAGE_MEASUREMENTS and
CONTROL)"), // 7
+ MANAGE_ALERTS(Target.RESOURCE), // 7
/**
* can C/U/D metric schedules
*/
- MANAGE_MEASUREMENTS(Target.RESOURCE, "Manage Measurements", "can C/U/D
metric schedules"), // 8
+ MANAGE_MEASUREMENTS(Target.RESOURCE), // 8
/**
* can C/U/D content (package bits, software updates, etc.)
*/
- MANAGE_CONTENT(Target.RESOURCE, "Manage Content", "can C/U/D content
(package bits, software updates, etc.)"), // 9
+ MANAGE_CONTENT(Target.RESOURCE), // 9
/**
* can invoke operations and delete operation history items
*/
- CONTROL(Target.RESOURCE, "Execute Operations", "can invoke operations
and delete operation history items"), // 10
+ CONTROL(Target.RESOURCE), // 10
/**
* can C/U/D resource config (e.g. reconfiguring JBoss to listen for jnp on port
1199);
* having this permission implies having {@link #CONFIGURE_READ}
*/
- CONFIGURE_WRITE(Target.RESOURCE, "Update Configuration",
- "can C/U/D resource config (e.g. reconfiguring JBoss to listen for jnp on
port 1199); "
- + "having this permission implies having CONFIGURE_READ"), // 11
+ CONFIGURE_WRITE(Target.RESOURCE), // 11
/**
* can C/U/D provisioning bundles
*/
// NOTE: This is a GLOBAL permission, but is defined down here so as to maintain the
ordinal indexes of the other
// pre-existing permissions.
- MANAGE_BUNDLE(Target.GLOBAL, "Manage Bundles", "can C/U/D provisioning
bundles"), // 12
+ MANAGE_BUNDLE(Target.GLOBAL), // 12
/**
* can view Resource configuration, but can not necessarily C/U/D unless {@link
#CONFIGURE_WRITE} is also possessed
*/
- CONFIGURE_READ(Target.RESOURCE, "View Configuration",
- "can view Resource configuration, but can not necessarily C/U/D unless
CONFIGURE_WRITE is also possessed"), // 13
+ CONFIGURE_READ(Target.RESOURCE), // 13
/**
* can C/U/D events
* (in the future, will also C/U/D event definitions)
*/
- MANAGE_EVENTS(Target.RESOURCE, "Manage Events", "can C/U/D
events") // 14
+ MANAGE_EVENTS(Target.RESOURCE) // 14
;
@@ -149,20 +137,8 @@ public enum Permission {
private Target target;
- /**
- * a brief display name for the permission (TODO: i18n)
- */
- private String displayName;
-
- /**
- * a one or two sentence description of the permission (TODO: i18n)
- */
- private String description;
-
- Permission(Target target, String displayName, String description) {
+ Permission(Target target) {
this.target = target;
- this.displayName = displayName;
- this.description = description;
}
/**
@@ -174,16 +150,8 @@ public enum Permission {
return target;
}
- public String getDisplayName() {
- return displayName;
- }
-
- public String getDescription() {
- return description;
- }
-
- public static final HashSet<Permission> GLOBAL_ALL = new
HashSet<Permission>();
- public static final HashSet<Permission> RESOURCE_ALL = new
HashSet<Permission>();
+ public static final Set<Permission> GLOBAL_ALL = new
HashSet<Permission>();
+ public static final Set<Permission> RESOURCE_ALL = new
HashSet<Permission>();
static {
for (Permission permission : Permission.values()) {
switch (permission.getTarget()) {
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/PermissionsItem.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/PermissionsItem.java
index b7c8fce..830330a 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/PermissionsItem.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/PermissionsItem.java
@@ -52,8 +52,8 @@ import org.rhq.enterprise.gui.coregui.client.util.message.Message;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVStack;
/**
- * A complex form item for editing the set of RHQ {@link Permission permission}s
associated with an RHQ
- * {@link Role role}.
+ * A complex form item for editing the set of RHQ {@link Permission permission}s
associated with an RHQ {@link Role
+ * role}.
*
* @author Ian Springer
*/
@@ -201,65 +201,65 @@ public class PermissionsItem extends CanvasItem {
ListGridRecord record = createResourcePermissionRecord("Inventory",
"subsystems/inventory/Inventory",
Permission.VIEW_RESOURCE,
- "view Resource properties (name, description, version, etc.), connection
settings, and connection settings history (IMPLIED)",
+ "(IMPLIED) view Resource properties (name, description, version, etc.),
connection settings, and connection settings history",
Permission.MODIFY_RESOURCE,
"update Resource name, version, description, and connection settings;
delete connection settings history items");
records.add(record);
record = createResourcePermissionRecord("Manage Measurements",
"subsystems/monitor/Monitor",
Permission.VIEW_RESOURCE,
- "TODO (IMPLIED)",
+ "(IMPLIED) view metric data and collection schedules",
Permission.MANAGE_MEASUREMENTS,
- "TODO");
+ "update metric collection schedules");
records.add(record);
record = createResourcePermissionRecord("Manage Alerts",
"subsystems/alert/Alerts",
Permission.VIEW_RESOURCE,
- "TODO (IMPLIED)",
+ "(IMPLIED) view alert definitions and alert history",
Permission.MANAGE_ALERTS,
- "TODO");
+ "create, update, and delete alert definitions; acknowledge and delete
alert history items");
records.add(record);
record = createResourcePermissionRecord("Configure",
"subsystems/configure/Configure",
Permission.CONFIGURE_READ,
- "TODO",
+ "view Resource configuration and Resource configuration revision
history",
Permission.CONFIGURE_WRITE,
- "TODO");
+ "update Resource configuration; delete Resource configuration revision
history items");
records.add(record);
record = createResourcePermissionRecord("Control",
"subsystems/control/Operation",
Permission.VIEW_RESOURCE,
- "TODO (IMPLIED)",
+ "(IMPLIED) view available operations and operation execution
history",
Permission.CONTROL,
- "TODO");
+ "execute operations; delete operation execution history items");
records.add(record);
record = createResourcePermissionRecord("Manage Events",
"subsystems/event/Events",
Permission.VIEW_RESOURCE,
- "TODO (IMPLIED)",
+ "(IMPLIED) view events",
Permission.MANAGE_EVENTS,
- "TODO");
+ "delete events");
records.add(record);
record = createResourcePermissionRecord("Manage Content",
"subsystems/content/Content",
Permission.VIEW_RESOURCE,
- "TODO (IMPLIED)",
+ "(IMPLIED) view installed and available packages; view package
installation history",
Permission.MANAGE_CONTENT,
- "TODO");
+ "subscribe to content sources; install and uninstall packages");
records.add(record);
record = createResourcePermissionRecord("Create Child Resources",
"subsystems/inventory/Inventory",
Permission.VIEW_RESOURCE,
- "TODO (IMPLIED)",
+ "(IMPLIED) view child creation history",
Permission.CREATE_CHILD_RESOURCES,
- "TODO");
+ "create new child Resources (for child Resources of types that are
creatable)");
records.add(record);
record = createResourcePermissionRecord("Delete Child Resources",
"subsystems/inventory/Inventory",
Permission.VIEW_RESOURCE,
- "TODO (IMPLIED)",
+ "(IMPLIED) view child deletion history",
Permission.DELETE_RESOURCE,
- "TODO");
+ "delete child Resources (for child Resources of types that are
deletable)");
records.add(record);
grid.setData(records.toArray(new ListGridRecord[records.size()]));