Users¶
A single BrainFrame server can have multiple users associated with it. Each user has their own username and password, and can be assigned roles that grant them different levels of access to the server.
Note that authorization is disabled by default for BrainFrame servers. See the Authorization Configuration section in the User Manual for details.
API Methods¶
-
BrainFrameAPI.
get_user
(user_id, timeout=30) → brainframe.api.bf_codecs.user_codecs.User¶ Gets the user with the given ID.
- Parameters
user_id – The ID of the user to get
timeout – The timeout to use for this request
- Returns
The user
-
BrainFrameAPI.
get_users
(timeout=30) → List[brainframe.api.bf_codecs.user_codecs.User]¶ Gets all users.
- Parameters
timeout – The timeout to use for this request
- Returns
Users
-
BrainFrameAPI.
set_user
(user, timeout=30) → brainframe.api.bf_codecs.user_codecs.User¶ Creates or updates a user. Only admin users may make this request.
A new user is created if the given user’s ID is None.
- Parameters
user – The user to create or update
timeout – The timeout to use for this request
- Returns
Created or updated user
-
BrainFrameAPI.
delete_user
(user_id, timeout=30)¶ Deletes a user. Only admin users may make this request.
- Parameters
user_id – The ID of the user to delete
timeout – The timeout to use for this request
Data Structures¶
-
class
RoleType
(value)¶ Controls the level of access a user has to API endpoints.
-
ADMIN
= 'admin'¶ A user that can access all endpoints.
-
EDITOR
= 'editor'¶ A user that can access most endpoints but cannot do administrative tasks like adding users and managing the license.
-
-
class
User
(*, username: str, password: Optional[str], role: brainframe.api.bf_codecs.user_codecs.RoleType, id_: int = None)¶ Contains information on a user.
-
id
: int¶ The user’s unique ID
-
password
: Optional[str]¶ This field will be None when retrieving users from the server. It should only be set by the client when creating a new user or updating a user’s password.
-
role
: RoleType¶ The user’s role
-
username
: str¶ The username used for login
-