Search in sources :

Example 1 with BulkRestRep

use of com.emc.storageos.model.BulkRestRep in project coprhd-controller by CoprHD.

the class TaggedResource method getBulkResources.

protected BulkRestRep getBulkResources(List<URI> ids) {
    StorageOSUser user = getUserFromContext();
    BulkRestRep ret = null;
    if (ids.size() > _maxBulkSize) {
        throw APIException.badRequests.exceedingLimit("bulk size", _maxBulkSize);
    }
    // -sysadmin (if zone level resource or resource is system admin readable)
    if (_permissionsHelper.userHasGivenRole(user, null, Role.SYSTEM_MONITOR) || ((isZoneLevelResource() || isSysAdminReadableResource()) && _permissionsHelper.userHasGivenRole(user, null, Role.SYSTEM_ADMIN))) {
        _log.info("Bulk of {} for sysmonitor/sysadmin", getResourceClass().getSimpleName());
        ret = queryBulkResourceReps(ids);
    } else {
        _log.info("Bulk of {} for user", getResourceClass().getSimpleName());
        ret = queryFilteredBulkResourceReps(ids);
    }
    return ret;
}
Also used : BulkRestRep(com.emc.storageos.model.BulkRestRep) StorageOSUser(com.emc.storageos.security.authentication.StorageOSUser)

Aggregations

BulkRestRep (com.emc.storageos.model.BulkRestRep)1 StorageOSUser (com.emc.storageos.security.authentication.StorageOSUser)1