user_management.models.GlobalGroup(*args, **kwargs)¶Bases: user_management.models.Group
Represents a group that has global access, that is, not tied to a specific Kamaji Project.
| Parameters: |
|
|---|
user_management.models.Group(*args, **kwargs)¶Bases: django.db.models.base.Model
Represents a group of users that are tied to a Role.
| Parameters: | role_id (ForeignKey) – The role that this group maps to |
|---|
delete(**kwargs)¶Delete the Group
user_management.models.KamajiUser(id, user, ssh_key)¶Bases: shared.models.KamajiModel
| Parameters: |
|
|---|
set_global_role(role_name)¶Sets the global role of the user. Assures the user can only have one global role by removing any other global role (except the default_spectator role) after adding the new one. :raises: GlobalGroup.DoesNotExist
set_project_role(project, role_name)¶Sets the project role for this user. Assures a user can only have one role within a project by removing any roles in the same project before adding the new role. :raises: GlobalGroup.DoesNotExist
user_management.models.Permission(*args, **kwargs)¶Bases: django.db.models.base.Model
A named permission that has a relation with a number of ViewPermissions that in turn will define create, read, update, and delete permissions for a given view.
| Parameters: |
|
|---|
user_management.models.Project(*args, **kwargs)¶Bases: shared.openstack2.models.OSModel
Represents a project in Kamaji.
| Parameters: |
|
|---|
members¶| Returns: | All users that are members of a Global or Project Group that gives access to this project. |
|---|---|
| Return type: | list |
users¶Get all users in this project.
user_management.models.ProjectGroup(*args, **kwargs)¶Bases: user_management.models.Group
Represents a group that is tied to a Kamaji Project.
| Parameters: |
|
|---|
get_instances(project_groups)¶Get all Instances of the projects of the specified ProjectGroups.
user_management.models.Role(*args, **kwargs)¶Bases: django.db.models.base.Model
Represents a set of permissions.
| Parameters: |
|
|---|
user_management.models.ViewPermission(id, permission, view_name, create, read, update, delete)¶Bases: django.db.models.base.Model
| Parameters: |
|
|---|
user_management.permissions.jwt_response_payload_handler(token, user=None, request=None)¶This function generates the output returned when a user has successfully obtained a new token.
| Parameters: |
|
|---|---|
| Returns: | A dictionary with the token and the permissions the user has |
| Return type: |
user_management.project_extractor.ProjectExtractor¶Bases: object
Abstract Base Class for providing a custom project extraction method during the permission assessment. A custom project extraction method needs to be provided when a call to a View is connected to a specific project but it is not obvious which project from directly looking in the data attribute or kwargs of the request.
extract_project(request)¶Extract the project from the request and return the Project model instance.
| Note: | Override this method if the designated project cannot be easily extracted from the request by the common implemented solutions. |
|---|---|
| Parameters: | request (HttpRequest) – The incoming request. |
| Returns: | The model instance of the request. |
| Return type: | Project |
user_management.serializers.UserSerializer(instance=None, data=<class rest_framework.fields.empty>, **kwargs)¶Bases: rest_framework.serializers.Serializer
User serializer that should only be used for users with a kamajiuser assigned to them. project_roles are readonly.
user_management.views.GlobalGroupList(**kwargs)¶Bases: rest_framework.generics.ListCreateAPIView
List or create groups with global access tied to a role. Membership in a global group allows users to access endpoints not specifically tied to a project but that effect the whole environment.
user_management.views.GlobalGroupSingle(**kwargs)¶Bases: rest_framework.generics.RetrieveUpdateDestroyAPIView
Lookup a specific global group. Delete, update or show info about a single global group. This endpoint assigns membership to global groups.
user_management.views.PasswordChange(**kwargs)¶Bases: user_management.views.PasswordResetTokenValidationView
To change the password for a user, perform a post request containing a valid password reset token (token) and the requested new password (new password).
user_management.views.PasswordLinksList(**kwargs)¶Bases: rest_framework.views.APIView
The available endpoints managing password change
user_management.views.PasswordResetTokenValidationView(**kwargs)¶Bases: shared.views.LookupMixin, rest_framework.views.APIView
Validate a password reset token for a user. To perform token validation, POST a JSON object with token in a field named token.
user_management.views.ProjectGroupList(**kwargs)¶Bases: rest_framework.generics.ListCreateAPIView
List or create groups tied to a project and role. Membership in a project group allows users to reach project specific endpoints with info only relevant for the project of their group.
user_management.views.ProjectGroupSingle(**kwargs)¶Bases: rest_framework.generics.RetrieveUpdateDestroyAPIView, user_management.project_extractor.ProjectExtractor
Delete, update or show info about a single project group. This endpoints assigns membership to project groups.
user_management.views.ProjectGroupsPerProject(**kwargs)¶Bases: rest_framework.generics.ListAPIView
List all project groups associated with a specified group.
user_management.views.ProjectList(**kwargs)¶Bases: rest_framework.generics.ListCreateAPIView
List or create projects. A project can be assigned to a project group to allow users access to project specific endpoints.
user_management.views.ProjectMembership(**kwargs)¶Bases: rest_framework.views.APIView
View to add a user to a project with a specific role.
user_management.views.ProjectSingle(**kwargs)¶Bases: rest_framework.generics.RetrieveUpdateDestroyAPIView
Show info about a single project.
user_management.views.RequestPasswordChangeTokenView(**kwargs)¶Bases: rest_framework.views.APIView
To request a password reset, simply perform a post request. No body necessary.
user_management.views.UserList(**kwargs)¶Bases: rest_framework.generics.ListCreateAPIView
List or create users. A user can be assigned to a group to allow access to endpoints.
serializer_class¶alias of UserSerializer
user_management.views.UserManagementLinksList(**kwargs)¶Bases: rest_framework.generics.RetrieveAPIView
List all available endpoints under user_management.
user_management.views.UserSingle(**kwargs)¶Bases: rest_framework.generics.RetrieveUpdateDestroyAPIView
Delete, update or show info about a single user.
serializer_class¶alias of UserSerializer
user_management.views.UsersByProjectList(**kwargs)¶Bases: rest_framework.generics.ListAPIView
List users that are connected to KamajiUsers and are either member of a ProjectGroup for this project or is granted access to this project by being a Global Administrator or Spectator.
get_queryset()¶| Returns: | All users that has a kamajiuser and is a member of this project or a global project. |
|---|
serializer_class¶alias of UserSerializer