return grid;
}
private ListGrid createResourcePermissionsGrid() {
ListGrid grid = createPermissionsGrid();
// TODO: Add table title.
ListGridField iconField = createIconField();
ListGridField displayNameField = new ListGridField("displayName", MSG.common_title_name(), 130);
ListGridField descriptionField = new ListGridField("description", MSG.common_title_description());
descriptionField.setWrap(true);
ListGridField readField = createAuthorizedField("readAuthorized", MSG.view_adminRoles_permissions_isRead(),
"readName", grid, true);
ListGridField writeField = createAuthorizedField("writeAuthorized", MSG.view_adminRoles_permissions_isWrite(),
"writeName", grid, false);
grid.setFields(iconField, displayNameField, readField, writeField, descriptionField);
List<ListGridRecord> records = new ArrayList<ListGridRecord>();
ListGridRecord record = createResourcePermissionRecord(MSG.view_adminRoles_permissions_perm_inventory(),
"subsystems/inventory/Inventory", Permission.VIEW_RESOURCE,
MSG.view_adminRoles_permissions_permReadDesc_inventory(), Permission.MODIFY_RESOURCE,
MSG.view_adminRoles_permissions_permWriteDesc_inventory());
records.add(record);
record = createResourcePermissionRecord(MSG.view_adminRoles_permissions_perm_manageMeasurements(),
"subsystems/monitor/Monitor", Permission.VIEW_RESOURCE,
MSG.view_adminRoles_permissions_permReadDesc_manageMeasurements(), Permission.MANAGE_MEASUREMENTS,
MSG.view_adminRoles_permissions_permWriteDesc_manageMeasurements());
records.add(record);
record = createResourcePermissionRecord(MSG.view_adminRoles_permissions_perm_manageAlerts(),
"subsystems/alert/Alerts", Permission.VIEW_RESOURCE,
MSG.view_adminRoles_permissions_permReadDesc_manageAlerts(), Permission.MANAGE_ALERTS,
MSG.view_adminRoles_permissions_permWriteDesc_manageAlerts());
records.add(record);
record = createResourcePermissionRecord(MSG.view_adminRoles_permissions_perm_configure(),
"subsystems/configure/Configure", Permission.CONFIGURE_READ,
MSG.view_adminRoles_permissions_permReadDesc_configure(), Permission.CONFIGURE_WRITE,
MSG.view_adminRoles_permissions_permWriteDesc_configure());
records.add(record);
record = createResourcePermissionRecord(MSG.view_adminRoles_permissions_perm_control(),
"subsystems/control/Operation", Permission.VIEW_RESOURCE,
MSG.view_adminRoles_permissions_permReadDesc_control(), Permission.CONTROL,
MSG.view_adminRoles_permissions_permWriteDesc_control());
records.add(record);
record = createResourcePermissionRecord(MSG.view_adminRoles_permissions_perm_manageEvents(),
"subsystems/event/Events", Permission.VIEW_RESOURCE,
MSG.view_adminRoles_permissions_permReadDesc_manageEvents(), Permission.MANAGE_EVENTS,
MSG.view_adminRoles_permissions_permWriteDesc_manageEvents());
records.add(record);
record = createResourcePermissionRecord(MSG.view_adminRoles_permissions_perm_manageContent(),
"subsystems/content/Content", Permission.VIEW_RESOURCE,
MSG.view_adminRoles_permissions_permReadDesc_manageContent(), Permission.MANAGE_CONTENT,
MSG.view_adminRoles_permissions_permWriteDesc_manageContent());
records.add(record);
record = createResourcePermissionRecord(MSG.view_adminRoles_permissions_perm_createChildResources(),
"subsystems/inventory/CreateChild", Permission.VIEW_RESOURCE,
MSG.view_adminRoles_permissions_permReadDesc_createChildResources(), Permission.CREATE_CHILD_RESOURCES,
MSG.view_adminRoles_permissions_permWriteDesc_createChildResources());
records.add(record);
record = createResourcePermissionRecord(MSG.view_adminRoles_permissions_perm_deleteChildResources(),
"subsystems/inventory/DeleteChild", Permission.VIEW_RESOURCE,
MSG.view_adminRoles_permissions_permReadDesc_deleteChildResources(), Permission.DELETE_RESOURCE,
MSG.view_adminRoles_permissions_permWriteDesc_deleteChildResources());
records.add(record);
record = createResourcePermissionRecord(MSG.view_adminRoles_permissions_perm_manageDrift(),
"subsystems/drift/Drift", Permission.VIEW_RESOURCE,
MSG.view_adminRoles_permissions_permReadDesc_manageDrift(), Permission.MANAGE_DRIFT,
MSG.view_adminRoles_permissions_permWriteDesc_manageDrift());
records.add(record);
grid.setData(records.toArray(new ListGridRecord[records.size()]));
return grid;
}