/* * POST to deactivate filesystem */ @POST @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) @Path("/{id}/deactivate") public TaskResourceRep deactivateFileSystemInternal( @PathParam("id") URI id, FileSystemDeleteParam param) throws InternalException { ArgValidator.checkFieldUriType(id, FileShare.class, "id"); FileShare fs = _fileService.queryResource(id); checkFileShareInternal(fs); TenantOrg tenant = _permissionsHelper.getRootTenant(); if (!_permissionsHelper.userHasGivenRole( getUserFromContext(), tenant.getId(), Role.SYSTEM_ADMIN, Role.TENANT_ADMIN)) { throw APIException.forbidden.onlyAdminsCanDeactivateFileSystems( Role.SYSTEM_ADMIN.toString(), Role.TENANT_ADMIN.toString()); } return _fileService.deactivateFileSystem(id, param); }