use of controllers.deadbolt.Restrictions in project coprhd-controller by CoprHD.
the class Tenants method editRole.
@Restrictions({ @Restrict("SECURITY_ADMIN"), @Restrict("TENANT_ADMIN") })
public static void editRole(@Required String id) {
// Extract info from id
String name = TenantRoleAssignmentForm.extractNameFromId(id);
RoleAssignmentType type = TenantRoleAssignmentForm.extractTypeFromId(id);
String tId = TenantRoleAssignmentForm.extractTenantFromId(id);
String tenantId = params.get("tenantId");
RoleAssignmentEntry roleAssignmentEntry = getTenantRoleAssignment(name, type, ResourceUtils.uri(tId));
if (roleAssignmentEntry != null) {
addTenantAndRolesToRenderArgs(tenantId);
Boolean isRootUser = RoleAssignmentUtils.isRootUser(roleAssignmentEntry);
TenantRoleAssignmentForm roleAssignment = new TenantRoleAssignmentForm();
roleAssignment.id = id;
roleAssignment.tenantId = tenantId;
roleAssignment.readFrom(roleAssignmentEntry);
render(roleAssignment, isRootUser);
} else {
flash.error(MessagesUtils.get("roleAssignments.unknown", name));
listRoles(tenantId);
}
}
use of controllers.deadbolt.Restrictions in project coprhd-controller by CoprHD.
the class Tenants method listRolesJson.
@Restrictions({ @Restrict("SECURITY_ADMIN"), @Restrict("TENANT_ADMIN") })
public static void listRolesJson(String id) {
List<RoleAssignmentEntry> viprRoleAssignments = getTenantRoleAssignments(id);
List<TenantRoleAssignmentDataTable.RoleInfo> roles = Lists.newArrayList();
for (RoleAssignmentEntry viprRoleAssignment : viprRoleAssignments) {
roles.add(new TenantRoleAssignmentDataTable.RoleInfo(viprRoleAssignment, id));
}
renderJSON(DataTablesSupport.createJSON(roles, params));
}
use of controllers.deadbolt.Restrictions in project coprhd-controller by CoprHD.
the class Tenants method listRoles.
@Restrictions({ @Restrict("SECURITY_ADMIN"), @Restrict("TENANT_ADMIN") })
public static void listRoles(String id) {
TenantRoleAssignmentDataTable dataTable = new TenantRoleAssignmentDataTable(uri(id));
TenantOrgRestRep tenant = TenantUtils.getTenant(id);
render("@listRoles", dataTable, tenant);
}
use of controllers.deadbolt.Restrictions in project coprhd-controller by CoprHD.
the class Orders method allOrdersJson.
@Restrictions({ @Restrict("TENANT_ADMIN") })
public static void allOrdersJson(Integer maxDays) {
DataTableParams dataTableParams = DataTablesSupport.createParams(params);
RecentUserOrdersDataTable dataTable = new RecentUserOrdersDataTable();
dataTable.setByStartEndDateOrMaxDays(params.get("startDate"), params.get("endDate"), maxDays);
renderJSON(DataTablesSupport.createJSON(dataTable.fetchData(dataTableParams), params));
}
Aggregations