Skip to content

Latest commit

 

History

History
911 lines (669 loc) · 44.1 KB

SettingsSecurityApi.md

File metadata and controls

911 lines (669 loc) · 44.1 KB

docspace_api_sdk.SecurityApi

All URIs are relative to https://your-docspace.onlyoffice.com

Method HTTP request Description
get_enabled_modules GET /api/2.0/settings/security/modules Get enabled modules
get_is_product_administrator GET /api/2.0/settings/security/administrator Check product administrator
get_password_settings GET /api/2.0/settings/security/password Get password settings
get_product_administrators GET /api/2.0/settings/security/administrator/{productId} Get product administrators
get_web_item_security_info GET /api/2.0/settings/security/{id} Check module availability
get_web_item_settings_security_info GET /api/2.0/settings/security Get module access settings
set_access_to_web_items PUT /api/2.0/settings/security/access Set access to modules in bulk
set_product_administrator PUT /api/2.0/settings/security/administrator Set product administrator
set_web_item_security PUT /api/2.0/settings/security Set module access
update_password_settings PUT /api/2.0/settings/security/password Update password settings

get_enabled_modules

EnabledModuleArrayWrapper get_enabled_modules()

Lists the portal modules the calling user can currently open, each as an id holding the module's product class name and a title holding its display name, both HTML-encoded. Any signed-in member may call this; anonymous callers are not admitted. The operation is read-only and takes no parameters, and the list is specific to the caller: modules hidden for this portal, and modules whose access rules exclude the caller, are left out, and sub-modules nested under another module are never listed. Entries follow the portal's own module order rather than an alphabetical one. An empty list means the installation registers no such modules at all - the case on DocSpace, where the classic modules do not exist - and is not a failure. The identifiers here are display-oriented class names, not the GUIDs the access-settings operations work with, so do not feed them to GET api/2.0/settings/security/{id}, which expects a module GUID.

For more information, see api.onlyoffice.com.

Parameters

This endpoint does not need any parameter.

Return type

EnabledModuleArrayWrapper

Authorization

Basic, OAuth2, ApiKeyBearer, asc_auth_key, Bearer, OpenId

Example

import docspace_api_sdk
from docspace_api_sdk.models.enabled_module_array_wrapper import EnabledModuleArrayWrapper
from docspace_api_sdk.rest import ApiException
from pprint import pprint

configuration = docspace_api_sdk.Configuration(
    host = "https://your-docspace.onlyoffice.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization (JWT): Bearer
configuration = docspace_api_sdk.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with docspace_api_sdk.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = docspace_api_sdk.SecurityApi(api_client)

    try:
        # Get enabled modules
        api_response = api_instance.get_enabled_modules()
        print("The response of SecurityApi->get_enabled_modules:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling SecurityApi->get_enabled_modules: %s\n" % e)

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 The portal modules the calling user can open, each with its product class name and its display name, in the portal's own module order * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-RateLimit-Reset -
401 Unauthorized -
429 Too Many Requests. * Retry-After -
500 Internal Server Error. -
502 Bad Gateway. Returned by the reverse proxy, response body may be HTML and not JSON. -
503 Service Unavailable. Returned by the reverse proxy, response body may be HTML and not JSON. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_is_product_administrator

ProductAdministratorWrapper get_is_product_administrator(product_id, user_id)

Reports whether one user administers one portal module, as the identifiers asked about plus an administrator flag. Both productid and userid are query parameters and both are required; the all-zero product GUID asks about the portal itself rather than about a single module. The caller needs the portal-settings right of a DocSpace administrator, otherwise the call is refused. The operation is read-only. The flag is true when the user belongs to the DocSpace administrator group or to the module's own group, so a portal-wide administrator is reported as an administrator of every module, whatever the module identifier says. Identifiers that name no user and no group are answered with false instead of a failure, so a false does not prove the user exists. The verdict is read out of group membership alone and says nothing about whether the module is enabled for this portal, which GET api/2.0/settings/security/{id} reports. Use GET api/2.0/settings/security/administrator/{productId} to list everyone who administers a module, and PUT api/2.0/settings/security/administrator to change the membership.

For more information, see api.onlyoffice.com.

Parameters

Name Type Description Notes
product_id UUID The module being asked about, by module GUID. The all-zero GUID asks about the portal itself rather than a single module.
user_id UUID The account being asked about, by portal user ID. An ID that names no account is answered as a plain negative rather than a failure, so a negative answer does not prove the account exists.

Return type

ProductAdministratorWrapper

Authorization

Basic, OAuth2, ApiKeyBearer, asc_auth_key, Bearer, OpenId

Example

import docspace_api_sdk
from docspace_api_sdk.models.product_administrator_wrapper import ProductAdministratorWrapper
from docspace_api_sdk.rest import ApiException
from pprint import pprint

configuration = docspace_api_sdk.Configuration(
    host = "https://your-docspace.onlyoffice.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization (JWT): Bearer
configuration = docspace_api_sdk.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with docspace_api_sdk.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = docspace_api_sdk.SecurityApi(api_client)
    product_id = UUID('00000000-0000-0000-0000-000000000000') # UUID | The module being asked about, by module GUID. The all-zero GUID asks about the portal itself rather than a  single module.
    user_id = UUID('00000000-0000-0000-0000-000000000000') # UUID | The account being asked about, by portal user ID. An ID that names no account is answered as a plain negative  rather than a failure, so a negative answer does not prove the account exists.

    try:
        # Check product administrator
        api_response = api_instance.get_is_product_administrator(product_id, user_id)
        print("The response of SecurityApi->get_is_product_administrator:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling SecurityApi->get_is_product_administrator: %s\n" % e)

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 The module and the user asked about together with the flag that says whether that user administers the module * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-RateLimit-Reset -
403 The caller has no portal-settings right -
401 Unauthorized -
429 Too Many Requests. * Retry-After -
500 Internal Server Error. -
400 Bad Request. -
502 Bad Gateway. Returned by the reverse proxy, response body may be HTML and not JSON. -
503 Service Unavailable. Returned by the reverse proxy, response body may be HTML and not JSON. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_password_settings

PasswordSettingsWrapper get_password_settings()

Returns the password policy of the current portal: the minimum length together with the flags that demand an uppercase letter, a digit and a special symbol, plus the regular expressions a client can check a password against before sending it anywhere. Any signed-in member may read it, and it is also reachable with the parameters of a confirmation link, so an invited user or one resetting a password can validate the new password before having a session; a portal whose payment has lapsed still answers. The operation is read-only and honours If-Modified-Since: send back the Last-Modified value of an earlier answer and an unchanged policy comes back as an empty not-modified response rather than a body. A portal nobody has configured requires 8 characters with all three flags off. Whatever the policy says, the portal refuses a password longer than 30 characters, a ceiling this answer does not carry. Change the policy with PUT api/2.0/settings/security/password.

For more information, see api.onlyoffice.com.

Parameters

This endpoint does not need any parameter.

Return type

PasswordSettingsWrapper

Authorization

Basic, OAuth2, ApiKeyBearer, asc_auth_key, Bearer, OpenId

Example

import docspace_api_sdk
from docspace_api_sdk.models.password_settings_wrapper import PasswordSettingsWrapper
from docspace_api_sdk.rest import ApiException
from pprint import pprint

configuration = docspace_api_sdk.Configuration(
    host = "https://your-docspace.onlyoffice.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization (JWT): Bearer
configuration = docspace_api_sdk.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with docspace_api_sdk.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = docspace_api_sdk.SecurityApi(api_client)

    try:
        # Get password settings
        api_response = api_instance.get_password_settings()
        print("The response of SecurityApi->get_password_settings:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling SecurityApi->get_password_settings: %s\n" % e)

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 The portal password policy: the minimum length, the uppercase, digit and special-symbol requirements, and the regular expressions a client can validate against * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-RateLimit-Reset -
304 The password policy has not changed since the Last-Modified value sent back in If-Modified-Since; the body is empty -
401 Unauthorized -
429 Too Many Requests. * Retry-After -
500 Internal Server Error. -
502 Bad Gateway. Returned by the reverse proxy, response body may be HTML and not JSON. -
503 Service Unavailable. Returned by the reverse proxy, response body may be HTML and not JSON. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_product_administrators

EmployeeArrayWrapper get_product_administrators(product_id)

Lists the users who administer the portal module identified by productid in the path. The all-zero GUID stands for the portal itself: the answer then covers the DocSpace administrator group together with every product group, and includes the portal owner, who administers everything by default. The caller needs the portal-settings right of a DocSpace administrator, otherwise the call is refused. productid has to be a GUID, and one that names no group is answered with an empty list rather than a failure. The operation is read-only and returns whole user profiles, a heavier answer than a membership check, and a user who belongs to more than one of the groups asked about is listed once per group. Entries arrive in group order, the DocSpace administrator group first, the list is neither paged nor filterable, and a promotion made through the sibling PUT shows up here at once. Use GET api/2.0/settings/security/administrator to test a single user against a single module, and PUT api/2.0/settings/security/administrator to promote or demote somebody.

For more information, see api.onlyoffice.com.

Parameters

Name Type Description Notes
product_id UUID The module the operation acts on, by module GUID. The all-zero GUID stands for the portal itself rather than for a single module, and a GUID that names no module group is answered with an empty result instead of a failure.

Return type

EmployeeArrayWrapper

Authorization

Basic, OAuth2, ApiKeyBearer, asc_auth_key, Bearer, OpenId

Example

import docspace_api_sdk
from docspace_api_sdk.models.employee_array_wrapper import EmployeeArrayWrapper
from docspace_api_sdk.rest import ApiException
from pprint import pprint

configuration = docspace_api_sdk.Configuration(
    host = "https://your-docspace.onlyoffice.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization (JWT): Bearer
configuration = docspace_api_sdk.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with docspace_api_sdk.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = docspace_api_sdk.SecurityApi(api_client)
    product_id = UUID('00000000-0000-0000-0000-000000000000') # UUID | The module the operation acts on, by module GUID. The all-zero GUID stands for the portal itself rather than  for a single module, and a GUID that names no module group is answered with an empty result instead of a  failure.

    try:
        # Get product administrators
        api_response = api_instance.get_product_administrators(product_id)
        print("The response of SecurityApi->get_product_administrators:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling SecurityApi->get_product_administrators: %s\n" % e)

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 The users who administer the module asked about, or the portal-wide administrators when the all-zero identifier is used * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-RateLimit-Reset -
403 The caller has no portal-settings right -
401 Unauthorized -
429 Too Many Requests. * Retry-After -
500 Internal Server Error. -
400 Bad Request. -
502 Bad Gateway. Returned by the reverse proxy, response body may be HTML and not JSON. -
503 Service Unavailable. Returned by the reverse proxy, response body may be HTML and not JSON. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_web_item_security_info

BooleanWrapper get_web_item_security_info(id)

Answers whether the module with the given identifier is available to the calling user right now, as a single boolean. id is the module GUID and travels in the path; a value that is not a GUID does not match the route at all. Any signed-in member may call this; anonymous callers are not admitted. The operation is read-only and its answer is specific to the caller: true means a module with that identifier is registered in this portal, is visible, and the caller is allowed to read it, while false covers every other case - the module is not registered here, it is hidden for this portal, or the caller is outside the users and groups allowed to open it. A false therefore does not tell those apart, and an unknown identifier is reported as unavailable instead of failing. Read the allow-list behind the decision with GET api/2.0/settings/security, list the modules the caller can actually open with GET api/2.0/settings/security/modules, and change access with PUT api/2.0/settings/security.

For more information, see api.onlyoffice.com.

Parameters

Name Type Description Notes
id UUID The identifier of the object the operation acts on, as the listing operation of that kind of object reports it. It has to match the shape the route declares - a GUID where the route is typed as one - since a value of another shape does not match the route at all and is answered as not found.

Return type

BooleanWrapper

Authorization

Basic, OAuth2, ApiKeyBearer, asc_auth_key, Bearer, OpenId

Example

import docspace_api_sdk
from docspace_api_sdk.models.boolean_wrapper import BooleanWrapper
from docspace_api_sdk.rest import ApiException
from pprint import pprint

configuration = docspace_api_sdk.Configuration(
    host = "https://your-docspace.onlyoffice.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization (JWT): Bearer
configuration = docspace_api_sdk.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with docspace_api_sdk.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = docspace_api_sdk.SecurityApi(api_client)
    id = UUID('1') # UUID | The identifier of the object the operation acts on, as the listing operation of that kind of object reports  it. It has to match the shape the route declares - a GUID where the route is typed as one - since a value of  another shape does not match the route at all and is answered as not found.

    try:
        # Check module availability
        api_response = api_instance.get_web_item_security_info(id)
        print("The response of SecurityApi->get_web_item_security_info:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling SecurityApi->get_web_item_security_info: %s\n" % e)

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Whether the module is registered, visible and readable by the calling user - false covers a module that is not registered here as well as one the caller may not open * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-RateLimit-Reset -
401 Unauthorized -
429 Too Many Requests. * Retry-After -
500 Internal Server Error. -
400 Bad Request. -
502 Bad Gateway. Returned by the reverse proxy, response body may be HTML and not JSON. -
503 Service Unavailable. Returned by the reverse proxy, response body may be HTML and not JSON. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_web_item_settings_security_info

SecurityArrayWrapper get_web_item_settings_security_info(ids=ids)

Reports how access to the portal's own modules is configured: for every module identifier sent in ids, whether access is restricted at all and which users and groups are allowed to open the module. Send the identifiers as repeated ids query values; each one has to be a GUID, and anything else is rejected as an invalid request. Omitting ids asks about every module registered in the portal, which on a DocSpace installation is none, so the answer is then an empty list rather than a failure. Any signed-in member may call this; anonymous callers are not admitted. The operation is read-only and answers one entry per identifier, in the order the identifiers were sent. enabled is false for a module nobody has ever configured, groups and users name the subjects the rule was stored for, and isSubItem marks a module that hangs under another one. Users the caller is not allowed to see are left out of users, so the same module can come back with different lists for different callers. Change any of this with PUT api/2.0/settings/security.

For more information, see api.onlyoffice.com.

Parameters

Name Type Description Notes
ids List[str] The modules to report on, each given as a GUID and sent as a repeated query value. An entry that is not a GUID fails the whole request as invalid. Leaving the list out asks about every module registered in the portal, which on a DocSpace installation is none, so the answer is then empty rather than complete. [optional]

Return type

SecurityArrayWrapper

Authorization

Basic, OAuth2, ApiKeyBearer, asc_auth_key, Bearer, OpenId

Example

import docspace_api_sdk
from docspace_api_sdk.models.security_array_wrapper import SecurityArrayWrapper
from docspace_api_sdk.rest import ApiException
from pprint import pprint

configuration = docspace_api_sdk.Configuration(
    host = "https://your-docspace.onlyoffice.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization (JWT): Bearer
configuration = docspace_api_sdk.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with docspace_api_sdk.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = docspace_api_sdk.SecurityApi(api_client)
    ids = ['[\"00000000-0000-0000-0000-000000000000\"]'] # List[str] | The modules to report on, each given as a GUID and sent as a repeated query value. An entry that is not a  GUID fails the whole request as invalid. Leaving the list out asks about every module registered in the  portal, which on a DocSpace installation is none, so the answer is then empty rather than complete. (optional)

    try:
        # Get module access settings
        api_response = api_instance.get_web_item_settings_security_info(ids=ids)
        print("The response of SecurityApi->get_web_item_settings_security_info:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling SecurityApi->get_web_item_settings_security_info: %s\n" % e)

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 The access configuration of every module identifier asked about: the enabled flag, the allowed groups, the allowed users the caller may see, and the sub-module flag * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-RateLimit-Reset -
400 An ids value is not a GUID -
401 Unauthorized -
429 Too Many Requests. * Retry-After -
500 Internal Server Error. -
502 Bad Gateway. Returned by the reverse proxy, response body may be HTML and not JSON. -
503 Service Unavailable. Returned by the reverse proxy, response body may be HTML and not JSON. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

set_access_to_web_items

SecurityArrayWrapper set_access_to_web_items(web_items_security_request_dto=web_items_security_request_dto)

Switches several portal modules on or off in one call: items carries an entry per module, its key the module GUID and its value the new enabled flag. 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. Every key has to be a GUID; anything else is rejected as an invalid request, and a module listed twice is applied once, from its first entry. This operation carries no subject list of its own: switching a product module on restores the users and groups it was last restricted to, while every other case is stored as a plain allow or deny for everyone, so use PUT api/2.0/settings/security when the allow-list itself has to change. The batch is recorded in the audit trail as one list update rather than module by module. The answer is the resulting configuration of every module listed, in the shape GET api/2.0/settings/security returns.

For more information, see api.onlyoffice.com.

Parameters

Name Type Description Notes
web_items_security_request_dto WebItemsSecurityRequestDto [optional]

Return type

SecurityArrayWrapper

Authorization

Basic, OAuth2, ApiKeyBearer, asc_auth_key, Bearer, OpenId

Example

import docspace_api_sdk
from docspace_api_sdk.models.security_array_wrapper import SecurityArrayWrapper
from docspace_api_sdk.models.web_items_security_request_dto import WebItemsSecurityRequestDto
from docspace_api_sdk.rest import ApiException
from pprint import pprint

configuration = docspace_api_sdk.Configuration(
    host = "https://your-docspace.onlyoffice.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization (JWT): Bearer
configuration = docspace_api_sdk.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with docspace_api_sdk.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = docspace_api_sdk.SecurityApi(api_client)
    web_items_security_request_dto = docspace_api_sdk.WebItemsSecurityRequestDto() # WebItemsSecurityRequestDto |  (optional)

    try:
        # Set access to modules in bulk
        api_response = api_instance.set_access_to_web_items(web_items_security_request_dto=web_items_security_request_dto)
        print("The response of SecurityApi->set_access_to_web_items:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling SecurityApi->set_access_to_web_items: %s\n" % e)

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 The resulting access configuration of every module listed in the request * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-RateLimit-Reset -
400 The request body cannot be read, or a key in items is not a GUID -
403 Per-module access cannot be configured on an open portal, or the caller lacks the portal-settings right of a DocSpace administrator -
401 Unauthorized -
429 Too Many Requests. * Retry-After -
500 Internal Server Error. -
502 Bad Gateway. Returned by the reverse proxy, response body may be HTML and not JSON. -
503 Service Unavailable. Returned by the reverse proxy, response body may be HTML and not JSON. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

set_product_administrator

ProductAdministratorWrapper set_product_administrator(security_request_dto=security_request_dto)

Promotes a portal member to administrator of one module, or takes that role away, according to the administrator flag; the all-zero product GUID targets the DocSpace administrator role, which covers the whole portal. The caller needs the portal-settings right of a DocSpace administrator, and granting the portal-wide role additionally requires being the portal owner - anyone else is refused with 403. A free cloud plan does not offer the option at all and answers 402, as does a promotion for which no paid seat is left, since promoting a guest or a plain member turns them into a paid one. Taking the portal-wide role away also removes the member from every product group. The change is immediate, portal-wide, recorded in the audit trail, and sending the same body twice changes nothing further; it never creates a user, so invite the member first. The answer echoes the identifiers and the flag as stored - re-read membership with GET api/2.0/settings/security/administrator.

For more information, see api.onlyoffice.com.

Parameters

Name Type Description Notes
security_request_dto SecurityRequestDto [optional]

Return type

ProductAdministratorWrapper

Authorization

Basic, OAuth2, ApiKeyBearer, asc_auth_key, Bearer, OpenId

Example

import docspace_api_sdk
from docspace_api_sdk.models.product_administrator_wrapper import ProductAdministratorWrapper
from docspace_api_sdk.models.security_request_dto import SecurityRequestDto
from docspace_api_sdk.rest import ApiException
from pprint import pprint

configuration = docspace_api_sdk.Configuration(
    host = "https://your-docspace.onlyoffice.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization (JWT): Bearer
configuration = docspace_api_sdk.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with docspace_api_sdk.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = docspace_api_sdk.SecurityApi(api_client)
    security_request_dto = docspace_api_sdk.SecurityRequestDto() # SecurityRequestDto |  (optional)

    try:
        # Set product administrator
        api_response = api_instance.set_product_administrator(security_request_dto=security_request_dto)
        print("The response of SecurityApi->set_product_administrator:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling SecurityApi->set_product_administrator: %s\n" % e)

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 The module, the user and the administrator flag as they were stored * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-RateLimit-Reset -
400 The request body cannot be read or has no productId or userId -
402 The portal plan does not offer product administrators, or no paid seat is left for the member being promoted -
403 The caller has no portal-settings right, or is not the portal owner and grants the portal-wide administrator role or takes a role away from a DocSpace administrator -
401 Unauthorized -
429 Too Many Requests. * Retry-After -
500 Internal Server Error. -
502 Bad Gateway. Returned by the reverse proxy, response body may be HTML and not JSON. -
503 Service Unavailable. Returned by the reverse proxy, response body may be HTML and not JSON. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

set_web_item_security

SecurityArrayWrapper set_web_item_security(web_item_security_request_dto=web_item_security_request_dto)

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.

For more information, see api.onlyoffice.com.

Parameters

Name Type Description Notes
web_item_security_request_dto WebItemSecurityRequestDto [optional]

Return type

SecurityArrayWrapper

Authorization

Basic, OAuth2, ApiKeyBearer, asc_auth_key, Bearer, OpenId

Example

import docspace_api_sdk
from docspace_api_sdk.models.security_array_wrapper import SecurityArrayWrapper
from docspace_api_sdk.models.web_item_security_request_dto import WebItemSecurityRequestDto
from docspace_api_sdk.rest import ApiException
from pprint import pprint

configuration = docspace_api_sdk.Configuration(
    host = "https://your-docspace.onlyoffice.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization (JWT): Bearer
configuration = docspace_api_sdk.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with docspace_api_sdk.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = docspace_api_sdk.SecurityApi(api_client)
    web_item_security_request_dto = docspace_api_sdk.WebItemSecurityRequestDto() # WebItemSecurityRequestDto |  (optional)

    try:
        # Set module access
        api_response = api_instance.set_web_item_security(web_item_security_request_dto=web_item_security_request_dto)
        print("The response of SecurityApi->set_web_item_security:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling SecurityApi->set_web_item_security: %s\n" % e)

HTTP request headers

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

HTTP response details

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

update_password_settings

PasswordSettingsWrapper update_password_settings(password_settings_request_dto=password_settings_request_dto)

Replaces the password policy of the whole portal with the four values sent: minLength and the three flags that demand an uppercase letter, a digit and a special symbol. There is no partial update - a flag left out of the body is stored as false - so read the current policy with GET api/2.0/settings/security/password and send it back with your change applied. The caller needs the portal-settings right of a DocSpace administrator, otherwise the call is refused. minLength has to sit between the floor the installation is configured with, 8 characters unless it was changed, and the ceiling of 30; anything outside is rejected as an invalid request. The new policy applies to passwords set from now on: existing passwords keep working until their owners change them, and nobody is asked to renew. The change is portal-wide, recorded in the audit trail, and sending the same body twice changes nothing further. The answer is the stored policy with its regular expressions.

For more information, see api.onlyoffice.com.

Parameters

Name Type Description Notes
password_settings_request_dto PasswordSettingsRequestDto [optional]

Return type

PasswordSettingsWrapper

Authorization

Basic, OAuth2, ApiKeyBearer, asc_auth_key, Bearer, OpenId

Example

import docspace_api_sdk
from docspace_api_sdk.models.password_settings_request_dto import PasswordSettingsRequestDto
from docspace_api_sdk.models.password_settings_wrapper import PasswordSettingsWrapper
from docspace_api_sdk.rest import ApiException
from pprint import pprint

configuration = docspace_api_sdk.Configuration(
    host = "https://your-docspace.onlyoffice.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization (JWT): Bearer
configuration = docspace_api_sdk.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with docspace_api_sdk.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = docspace_api_sdk.SecurityApi(api_client)
    password_settings_request_dto = docspace_api_sdk.PasswordSettingsRequestDto() # PasswordSettingsRequestDto |  (optional)

    try:
        # Update password settings
        api_response = api_instance.update_password_settings(password_settings_request_dto=password_settings_request_dto)
        print("The response of SecurityApi->update_password_settings:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling SecurityApi->update_password_settings: %s\n" % e)

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 The password policy as it was stored, including the regular expressions a client can validate against * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-RateLimit-Reset -
400 The request body cannot be read or has no minLength, or the minimum length is outside the range the installation allows -
403 The caller has no portal-settings right -
401 Unauthorized -
429 Too Many Requests. * Retry-After -
500 Internal Server Error. -
502 Bad Gateway. Returned by the reverse proxy, response body may be HTML and not JSON. -
503 Service Unavailable. Returned by the reverse proxy, response body may be HTML and not JSON. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]