Skip to main content

setWebItemSecurity

SecurityArrayWrapper setWebItemSecurity(WebItemSecurityRequestDto)

PUT /api/2.0/settings/security

Set module access

Replaces the access rules of one portal module: id names the module, enabled says whether it may be opened, and subjects lists the users and groups the rule is stored for. The caller needs the portal-settings right of a DocSpace administrator, and the call is answered with 403 on an open portal, where everyone is admitted and per-module rules would mean nothing. id has to be a GUID; anything else is rejected as an invalid request. The rules stored before are dropped rather than extended, so send the full list of subjects every time. Watch the empty cases: leaving subjects out applies enabled to everyone, while an empty subjects array is stored as access for everyone whatever enabled says. The change is recorded in the audit trail unless subjects was left out entirely. The answer is the module's resulting configuration as a single-entry list, in the shape GET api/2.0/settings/security returns. To switch several modules at once use PUT api/2.0/settings/security/access.

Parameters​

NameInTypeDescriptionNotes
WebItemSecurityRequestDtobodyWebItemSecurityRequestDto[optional]

Responses​

Status codeDescriptionTypeResponse headers
200The resulting access configuration of the module, as a single-entry listSecurityArrayWrapperX-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset
400The request body cannot be read or has no id, or the id is not a GUID--
403Per-module access cannot be configured on an open portal, or the caller lacks the portal-settings right of a DocSpace administrator--
401UnauthorizedErrorApiResponse-
429Too Many Requests.ErrorApiResponseRetry-After
500Internal Server Error.ErrorApiResponse-
502Bad Gateway. Returned by the reverse proxy, response body may be HTML and not JSON.--
503Service Unavailable. Returned by the reverse proxy, response body may be HTML and not JSON.--

Return type​

SecurityArrayWrapper

Authorization​

Basic, OAuth2 (scopes: read, write), ApiKeyBearer, asc_auth_key, Bearer, OpenId

HTTP request headers​

  • Content-Type: application/json
  • Accept: application/json