This document describes the authorization rules currently enforced in the application.
Permissions are implemented explicitly at the view level.
There is no separate permission layer or service abstraction.
- Most routes are protected using
@login_required. - Unauthenticated users are redirected to the login page.
- Registration and login routes are accessible only to unauthenticated users.
A Django superuser can:
- Access the control panel
- Create users
- Update or delete any user
- Update or delete any team
- Update or delete any task
Superuser checks are performed using:
request.user.is_superuser- Any authenticated user can create a task.
- The creator field is automatically set to the current user.
A task can be updated if the user is:
- The task creator
- Directly assigned to the task
- A member of a team assigned to the task
- A superuser
This logic is enforced in update_task.
A subtask can be created under a task if the user is:
- The task creator
- Directly assigned to the task
- A member of a team assigned to the task
- A superuser
This logic is enforced in create_sub_task.
A new team can be created and attached to a task if the user is:
- The task creator
- Directly assigned to the task
- A member of a team assigned to the task
- A superuser
This logic is enforced in create_sub_team.
A task can be deleted only if:
- The user is the task creator
- OR the user is a superuser
Being an assigned collaborator is not sufficient.
This logic is enforced in delete_task.
- Any authenticated user can create a team.
A team can be updated if the user is:
- A member of that team
- OR a superuser
Enforced in update_team.
A team can be deleted if the user is:
- A member of that team
- OR a superuser
Enforced in delete_team.
- Joining and leaving teams are done via POST routes.
- The current implementation allows adding or removing a user from a team via the route parameters.
- No additional restriction is enforced beyond authentication.
Enforced in enter_team and leave_team.
- Any authenticated user can view any user profile.
- Only a superuser can create a new user.
Enforced in create_user.
A profile can be updated if:
- The logged-in user owns that profile
- OR the user is a superuser
Enforced in update_user.
A user account can be deleted if:
- The logged-in user owns that profile
- OR the user is a superuser
Enforced in delete_user.
Deletion removes the Django User instance.