-
Notifications
You must be signed in to change notification settings - Fork 161
Add permissions based on department #572
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
GDay
wants to merge
41
commits into
master
Choose a base branch
from
add-permissions-based-on-department
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 7 commits
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
67897a3
wip
GDay 9d99b24
add department create/list
GDay 01fab29
adding selectors for templates/admin task
GDay 57cb47b
fix tests
GDay 4c74c9e
format
GDay 07cfd45
redo migrations
GDay fed6fe6
fix copilot comments
GDay 04325c5
update department on sequence
GDay 972223f
format
GDay ebef5fb
revert admin_task refactor
GDay 3be8f3c
format
GDay 72b8c1c
limit items in sequence block view
GDay 577038d
limit integrations
GDay f0b336c
Merge branch 'master' into add-permissions-based-on-department
GDay 9693aa9
add form date widget instead of full form element
GDay d9878d0
Merge branch 'master' into add-permissions-based-on-department
GDay c6b520c
fix selector on user list intro
GDay 3ce201d
update get_user_model to User
GDay 43b05e2
change queryset name
GDay 2b49ac9
remove else
GDay 7458468
add ordering on department model
GDay 2ba3199
add back defer content
GDay 18a7e2a
change test to use template
GDay 6774d3a
rename mixin
GDay 3e8acdf
remove badge queryset
GDay 0b34775
add distinct
GDay ea00823
replace get_object with object
GDay 4489504
use self.object
GDay 2f1f649
replace get_user_model with User
GDay e3eee87
explicitly set elif manager
GDay 8a52ab2
remove else
GDay ae46fec
remove else
GDay 0d15515
fix keyerror
GDay 1e806e5
add test for formating departments
GDay f69875f
fix admin task test failure
GDay 0f01135
Merge branch 'master' into add-permissions-based-on-department
GDay 3640f3a
add block on removing existing departments + add tests
GDay 9d77ef3
Merge branch 'master' into add-permissions-based-on-department
GDay 735ce89
format
GDay 48857f7
remove queryset on hardware create
GDay f5b8970
fix warning
GDay File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| from admin.admin_tasks.models import AdminTask | ||
| from users.models import User | ||
|
|
||
|
|
||
| def get_admin_tasks_for_department(*, user: User): | ||
| return AdminTask.objects.for_user(user=user) | ||
|
|
||
|
|
||
| def get_admin_tasks_for_user(*, user: User): | ||
| return AdminTask.objects.filter(assigned_to=user) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
back/admin/appointments/migrations/0009_alter_appointment_options_appointment_departments.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| # Generated by Django 5.2.6 on 2025-09-23 02:35 | ||
|
|
||
| from django.db import migrations, models | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
| dependencies = [ | ||
| ("appointments", "0008_auto_20220221_1338"), | ||
| ("users", "0043_remove_user_department_user_departments_and_more"), | ||
| ] | ||
|
|
||
| operations = [ | ||
| migrations.AlterModelOptions( | ||
| name="appointment", | ||
| options={"ordering": ("name",)}, | ||
| ), | ||
| migrations.AddField( | ||
| model_name="appointment", | ||
| name="departments", | ||
| field=models.ManyToManyField( | ||
| blank=True, | ||
| help_text="Leave empty to make it available for all managers/admins", | ||
| to="users.department", | ||
| ), | ||
| ), | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| from admin.appointments.models import Appointment | ||
| from users.models import User | ||
|
|
||
|
|
||
| def get_appointment_templates_for_user(*, user: User): | ||
| return Appointment.templates.for_user(user=user) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.