Search in sources :

Example 26 with Restrictions

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);
    }
}
Also used : RoleAssignmentType(models.RoleAssignmentType) RoleAssignmentUtils.createRoleAssignmentEntry(util.RoleAssignmentUtils.createRoleAssignmentEntry) RoleAssignmentEntry(com.emc.storageos.model.auth.RoleAssignmentEntry) Restrictions(controllers.deadbolt.Restrictions)

Example 27 with Restrictions

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));
}
Also used : TenantRoleAssignmentDataTable(models.datatable.TenantRoleAssignmentDataTable) RoleAssignmentUtils.createRoleAssignmentEntry(util.RoleAssignmentUtils.createRoleAssignmentEntry) RoleAssignmentEntry(com.emc.storageos.model.auth.RoleAssignmentEntry) Restrictions(controllers.deadbolt.Restrictions)

Example 28 with Restrictions

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);
}
Also used : TenantRoleAssignmentDataTable(models.datatable.TenantRoleAssignmentDataTable) Restrictions(controllers.deadbolt.Restrictions)

Example 29 with Restrictions

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));
}
Also used : DataTableParams(util.datatable.DataTableParams) Restrictions(controllers.deadbolt.Restrictions)

Aggregations

Restrictions (controllers.deadbolt.Restrictions)29 FlashException (controllers.util.FlashException)8 SiteRestRep (com.emc.storageos.model.dr.SiteRestRep)7 BackupDataTable (models.datatable.BackupDataTable)4 RoleAssignmentEntry (com.emc.storageos.model.auth.RoleAssignmentEntry)2 SiteIdListParam (com.emc.storageos.model.dr.SiteIdListParam)2 VirtualDataCenterRestRep (com.emc.storageos.model.vdc.VirtualDataCenterRestRep)2 ViPRSystemClient (com.emc.vipr.client.ViPRSystemClient)2 BackupRestoreStatus (com.emc.vipr.model.sys.backup.BackupRestoreStatus)2 NodeHealth (com.emc.vipr.model.sys.healthmonitor.NodeHealth)2 RecoveryStatus (com.emc.vipr.model.sys.recovery.RecoveryStatus)2 Date (java.util.Date)2 RebootNodeJob (jobs.RebootNodeJob)2 TenantRoleAssignmentDataTable (models.datatable.TenantRoleAssignmentDataTable)2 DateTime (org.joda.time.DateTime)2 RoleAssignmentUtils.createRoleAssignmentEntry (util.RoleAssignmentUtils.createRoleAssignmentEntry)2 SiteActive (com.emc.storageos.model.dr.SiteActive)1 SiteAddParam (com.emc.storageos.model.dr.SiteAddParam)1 SiteDetailRestRep (com.emc.storageos.model.dr.SiteDetailRestRep)1 SiteUpdateParam (com.emc.storageos.model.dr.SiteUpdateParam)1