use of controllers.deadbolt.Restrictions in project coprhd-controller by CoprHD.
the class Backup method list.
@Restrictions({ @Restrict("SYSTEM_ADMIN"), @Restrict("SYSTEM_MONITOR"), @Restrict("RESTRICTED_SYSTEM_ADMIN") })
public static void list(Type type) {
if (type == null) {
type = Type.LOCAL;
}
BackupDataTable dataTable = new BackupDataTable(type);
renderArgs.put("type", type);
render(dataTable);
}
use of controllers.deadbolt.Restrictions in project coprhd-controller by CoprHD.
the class Backup method getUploadStatus.
@Restrictions({ @Restrict("SYSTEM_ADMIN"), @Restrict("SYSTEM_MONITOR"), @Restrict("RESTRICTED_SYSTEM_ADMIN") })
public static void getUploadStatus(String id) {
BackupUploadStatus status = BackupUtils.getUploadStatus(id);
renderJSON(status);
}
use of controllers.deadbolt.Restrictions in project coprhd-controller by CoprHD.
the class Backup method itemsJson.
/**
* Get local backup info
* @param ids
*/
@Restrictions({ @Restrict("SYSTEM_ADMIN"), @Restrict("SYSTEM_MONITOR"), @Restrict("RESTRICTED_SYSTEM_ADMIN") })
public static void itemsJson(@As(",") String[] ids) {
List<BackupDataTable.Backup> results = Lists.newArrayList();
if (ids != null) {
for (String id : ids) {
if (StringUtils.isNotBlank(id)) {
BackupSet backupSet = BackupUtils.getBackup(id);
if (backupSet != null) {
BackupDataTable.Backup backup = new BackupDataTable.Backup(backupSet);
BackupRestoreStatus restoreStatus = BackupUtils.getRestoreStatus(id, true);
backup.alterLocalBackupRestoreStatus(restoreStatus);
results.add(backup);
}
}
}
}
renderJSON(results);
}
use of controllers.deadbolt.Restrictions in project coprhd-controller by CoprHD.
the class AdminDashboard method dbStatus.
@Restrictions({ @Restrict("SYSTEM_MONITOR"), @Restrict("SYSTEM_ADMIN"), @Restrict("RESTRICTED_SYSTEM_ADMIN") })
public static void dbStatus() {
DbRepairStatus dbstatus = AdminDashboardUtils.gethealthdb();
if (dbstatus.getLastCompletionTime() != null) {
DateTime endTime = new DateTime(dbstatus.getLastCompletionTime().getTime());
renderArgs.put("endTime", endTime);
}
if (dbstatus.getStartTime() != null) {
DateTime startTime = new DateTime(dbstatus.getStartTime().getTime());
renderArgs.put("startTime", startTime);
}
render(dbstatus);
}
use of controllers.deadbolt.Restrictions in project coprhd-controller by CoprHD.
the class AdminDashboard method version.
@Restrictions({ @Restrict("SYSTEM_MONITOR"), @Restrict("SYSTEM_ADMIN"), @Restrict("RESTRICTED_SYSTEM_ADMIN") })
public static void version() {
License license = AdminDashboardUtils.getLicense();
Map<String, Promise<?>> promises = Maps.newHashMap();
promises.put("clusterInfo", AdminDashboardUtils.clusterInfo());
trySetRenderArgs(promises);
// Add lastUpdated render args after promises are redeemed
Date clusterInfoLastUpdated = AdminDashboardUtils.getClusterInfoLastUpdated();
render(license, clusterInfoLastUpdated);
}
Aggregations