bluesky_httpserver.authorization.DefaultResourceAccessControl

class bluesky_httpserver.authorization.DefaultResourceAccessControl(*, default_group=None)[source]

Default resource access policy. The resource access policy associates users with user groups. The groups define the resources, such as plans and devices users can access. The default policy assumes that all uses belong to a singe group (default user group). The name of the group is returned by get_resource_name() method for any submitted username. The hard-coded name for the default user group can be modified by passing the parameter default_group to the class constructor. The arguments of the class constructor are specified in the configuration file as shown in the example below.

Parameters:
default_group: str

The name of the group returned by the access manager by default.

Examples

Configure DefaultResourceAccessControl policy to use different group name for all the users. The new default group name is test_user.

resource_access:
  policy: bluesky_httpserver.authorization:DefaultResourceAccessControl
  args:
    default_group: test_user
__init__(*, default_group=None)[source]

Methods

__init__(*[, default_group])

get_resource_group(username)

Returns the name of the user group based on the user name.