PermissionService#

class PermissionService[source]#

Methods

get_all

Get all the global permissions or all course permissions for all courses for the currently logged in user.

get_all(*, type, extra_parameters=None)[source]#

Get all the global permissions or all course permissions for all courses for the currently logged in user.

Parameters:
  • type (Literal['course', 'global']) – The type of permissions to get. This can be global or course. If course is passed this will return the permissions as if you have already paid, even if this is not the case. It will also not take any restrictions of this session into consideration.

  • extra_parameters (Optional[Mapping[str, Union[str, bool, int, float]]]) – The extra query parameters you might want to add. By default no extra query parameters are added.

  • self (PermissionService[AuthenticatedClient]) –

Returns:

The returning object depends on the given type. If it was global a mapping between permissions name and a boolean indicating if the currently logged in user has this permissions is returned. If it was course such a mapping is returned for every course the user is enrolled in. So it is a mapping between course ids and permission mapping.

Return type:

Mapping[str, CoursePermMap] | GlobalPermMap