Resolve "Add rules and permissions" #439
No reviewers
Labels
No labels
Security
TeX
auto-update
board
done
board
ready
board
todo
check
delete-eslint-rc-js
check
update-builddeps-package-json
check
update-eslint-rc-js
check
update-gitignore
check
update-merge-request-template
check
update-prettier-ignore
check
update-pyproject-toml
check
update-renovate-json
check
update-tox-ini
part
backend
part
ci
part
docs
part
frontend
part
i18n
part
non-technical
part
packaging
prio
1
prio
2
prio
3
release-mr-5.x
size
large
size
medium
size
small
source
customer
source
customer::fsmw
source
customer::fss
source
customer::teckids
source
downstream
type
breaking
type
bug
type
feature
type
refactoring
workflow
blocked
workflow
confirmed
workflow
current-todo
workflow
discussing
workflow
new-app
workflow
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
aleksis/AlekSIS-App-Alsijil!439
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "73-add-rules-and-permissions"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #73
Closes #79
@yuha Please give feedback when your task will be finished.
added 1 commit
e65b4cb2- Add some more rules&permissionsCompare with previous version
Please use
gettext(without an u)Please add a docstring.
Please add a docstring.
I think the persons someone can select to register an absence should be filtered according to one's permissions. @yuha
assigned to @nik
@nik Please review as soon as it's possible for you – that would be very nice. (Despite it's still WIP.)
How is this related to permissions and rules?
It keeps the option open to filter the persons related to someone's permissions in the view.
"an absence"
"an absence"
Looks good on first glance.
However, I tend to not merge this without at least basic black/white test cases for the most important permissions.
added 34 commits
mastera85bcae6- Merge branch 'master' into 73-add-rules-and-permissionsCompare with previous version
added 1 commit
c0e47390- Merge branch 'master' into 73-add-rules-and-permissionsCompare with previous version
added 2 commits
a85bcae6- Merge branch 'master' into 73-add-rules-and-permissions451cdb33- Merge branch '73-add-rules-and-permissions' of...Compare with previous version
added 1 commit
2a84050c- Fix order of has_perm and perm check in lesson templateCompare with previous version
added 1 commit
45de9a0c- Merge branch 'master' into 73-add-rules-and-permissionsCompare with previous version
changed this line in version 9 of the diff
added 2 commits
420f07a0- Add rules&permissions in class register templatea95d775a- Replace ugettext with gettextCompare with previous version
added 1 commit
2011793a- Add tooltips in alsijil_helpers.pyCompare with previous version
changed this line in version 11 of the diff
changed this line in version 11 of the diff
added 1 commit
53bfe409- Fix typoCompare with previous version
resolved all threads
added 5 commits
a85bcae6- Merge branch 'master' into 73-add-rules-and-permissionsc0e47390- Merge branch 'master' into 73-add-rules-and-permissions451cdb33- Merge branch '73-add-rules-and-permissions' of...2a84050c- Fix order of has_perm and perm check in lesson template287cac5e- Merge branch '73-add-rules-and-permissions' of...Compare with previous version
added 2 commits
c940fbce- 1 commit from branchmaster442e28eb- Merge branch 'master' into 73-add-rules-and-permissionsCompare with previous version
added 1 commit
c8791096- Fix order of queries in week viewCompare with previous version
added 9 commits
master95f16ef8- Merge branch 'master' into 73-add-rules-and-permissions6b0eedfd- Fix lint issues and reformat filesCompare with previous version
added 1 commit
93203b44- Move annotate before union because annotating works only before unionCompare with previous version
added 1 commit
fbbb6020- Fix permission names and core/alsijil relationCompare with previous version
added 1 commit
f3cc545c- Convert pks of lesson periods to list to simplify queryCompare with previous version
added 1 commit
b1978f7a- Fixed permission for absence registerCompare with previous version
added 10 commits
master4cf0c8e6- Merge branch 'master' into 73-add-rules-and-permissionsb3df531e- Merge branch '73-add-rules-and-permissions' of...Compare with previous version
added 2 commits
52c06bb4- Merge branch '73-add-rules-and-permissions' of...262cf49e- Merge branch '73-add-rules-and-permissions' of...Compare with previous version
added 1 commit
b7fa224e- Annotate week in get_lesson_by_period_pkCompare with previous version
added 1 commit
26b63e39- Fix usage of RelatedQuerySet in predicateCompare with previous version
added 3 commits
master07ca4f09- Merge branch 'master' into 73-add-rules-and-permissionsCompare with previous version
@yuha Can you please add such tests?
mentioned in issue #81
added 5 commits
6e9a0f60- Add menu validators using rulesd524ad07- Rename personalnotefilter rules5eb56aae- Refactor predicates7365b60b- Fix is_person_group_owner predicate0292d973- Reformat predicatesCompare with previous version
added 2 commits
Compare with previous version
@yuha ?
Why this should be unnecessary?
TODO for @yuha 😉
As far as I know it should be possible to simply assign an object-specific permission for all objects to a user, so there must not be an extra global permission for it.
@yuha I don't know if I already had written or said it, but please also pay attention to substitutions (substitution teachers can access a lesson as well as regular teachers etc.)
added 34 commits
master9cff3804- Merge branch 'master' into 73-add-rules-and-permissions62c3ea5d- Add rules&permissions for excuse typesCompare with previous version
added 1 commit
63c96016- Also check whether a person is a teacher in a LessonSubstitution in is_lesson_teacherCompare with previous version
how do i do so?
"Add permissions for management of excuse types" done
As !458 is merged, it would be great if you could do the tasks in the comment above.
added 48 commits
master5143e011- Merge branch 'master' into 73-add-rules-and-permissions7652c383- Remove rests of personal note filters780fd921- ReformatCompare with previous version
added 1 commit
f1a5702d- Fix permissions in lesson.html after mergeCompare with previous version
TODO:
added 2 commits
49392296- 1 commit from branchmaster4daa50e1- Merge branch 'master' into 73-add-rules-and-permissionsCompare with previous version
added 1 commit
6da0a1a0- Fix rulesCompare with previous version
added 1 commit
87e90a54- Fix wrong used pkCompare with previous version
added 1 commit
910e001c- Fix is_lesson_teacher: Wrong qsCompare with previous version
Why did you change this? There are other use cases where a person should be able to view the register absence page - for example if this person has the permission to register absences for an entire group
Because this didn't work – the reason may be that I didn't checkout AlekSIS/official/AlekSIS!708. 😁
added 12 commits
mastere8144bc6- Merge branch 'master' into 73-add-rules-and-permissionsCompare with previous version
So can this be reverted?
Yes, of course.
changed this line in version 37 of the diff
added 1 commit
4ce2f988- Revert "Fix rules"Compare with previous version
added 2 commits
8f136405- Add permissions for management of extra marks867088d7- Fixed mixin sequency in class-based viewsCompare with previous version
You mean in the week overview? As far as I understand, they are actually filtered.
added 1 commit
9a6d823e- Fixed typo in extramark ruleCompare with previous version
added 1 commit
4964c534- Allow filtering of personal notes displayed in overview of last lesson and...Compare with previous version
added 1 commit
3daf91e8- Change rule nameCompare with previous version
added 2 commits
fe5d0416- add menu validator for extra marksbd4c962a- Change edit personal note ruleCompare with previous version
added 1 commit
f2151ca2- Remove usage of has_any_object and change to custom queriesCompare with previous version
added 20 commits
masterfc2f0f6c- Merge branch 'master' into 73-add-rules-and-permissionsCompare with previous version
added 1 commit
b422dae3- Fix queryCompare with previous version
added 1 commit
25dc771a- Use correct permission in viewsCompare with previous version
added 1 commit
39496545- Do not all queries in has_any_object_absence, only necessary onesCompare with previous version
added 1 commit
46259cb0- Fix is_lesson_teacher predicateCompare with previous version
added 1 commit
46259cb0- Fix is_lesson_teacher predicateCompare with previous version
added 3 commits
masterf6b135b2- Merge branch 'master' into 73-add-rules-and-permissionsCompare with previous version
added 1 commit
f9ba7388- ReformatCompare with previous version
added 1 commit
cbd4e140- Add several small bug fixesCompare with previous version
added 6 commits
0d6400b4- Filter possible selection in absence form16b2fb03- Merge branch '73-add-rules-and-permissions' into...5b18cc4e- Filter person dropdown list of absence registration form with custom queryset...017602dd- Add filtered dropdowns for week overviewf3864ef9- Merge branch '73-add-rules-and-permissions' into...0c1b499e- Merge branch '79-filter-selects-on-week-overview-and-register-absence' into...Compare with previous version
added 1 commit
66dd2f9c- Fix querysets in select formCompare with previous version
added 1 commit
e1aee095- Fix querysetsCompare with previous version
added 1 commit
ff67a50a- Fix querysetCompare with previous version
added 1 commit
fce909de- Fix form query methodCompare with previous version
added 1 commit
0cab5ee3- Fix request getter in SelectFormCompare with previous version
added 2 commits
d2331821- Simplify queryset in SelectForm0a2acd87- Check permission of lesson documentations in week viewCompare with previous version
added 1 commit
5a900697- Add missing load for template tagsCompare with previous version
added 1 commit
Compare with previous version
added 1 commit
32ad8b40- Fix view_week_personalnoteCompare with previous version
added 1 commit
ef75d02b- Fix is_personal_note_lesson_teacherCompare with previous version
added 1 commit
df357a62- Fix call of propertyCompare with previous version
mentioned in issue #98
changed the description
added 13 commits
masterf3206ef4- Merge branch 'master' into 73-add-rules-and-permissionsCompare with previous version
added 1 commit
e3d26b7d- Add permissions for students view and listCompare with previous version
Todo: Allow only primary group owners to register absences
added 4 commits
mastera5429af4- Merge branch 'master' into 73-add-rules-and-permissions0319cbcf- Fix register_absence rules (allow only primary group owners to register absences)Compare with previous version
added 2 commits
2c4e8922- Fix permissions and permission checks for person overview256bf855- ReformatCompare with previous version
added 16 commits
masterd2caa75c- Merge branch 'master' into 73-add-rules-and-permissions8262a4aa- Add permissions check for DeletePersonalNoteViewe37a73ca- [Person overview] Show delete button also when personal note is excusede4189166- ReformatCompare with previous version
mentioned in merge request !480
added 3 commits
mastere9282bc9- Merge branch 'master' into 73-add-rules-and-permissionsCompare with previous version
added 1 commit
45330d48- Simplify queryset in RegisterAbsenceFormCompare with previous version
added 4 commits
master120193ca- Merge branch 'master' into 73-add-rules-and-permissionsCompare with previous version
added 1 commit
cff25c97- Add permissions for "My groups"Compare with previous version
added 1 commit
34ef43d1- Add menu validator for "My groups"Compare with previous version
added 5 commits
mastered1fede6- Merge branch 'master' into 73-add-rules-and-permissionsCompare with previous version
added 2 commits
ee72ebc2- Fix problems with update_or_create and prefetching091caa94- Merge branch 'fix/update-or-create' into 73-add-rules-and-permissionsCompare with previous version
This should descriptively be derived from
view_lesson_predicate.This should also be stacked onto
view_lesson_personal_note.The configuration check should be here, not inside
is_own_personel_note.Should be based on the view counterpart.
Should probably be based on
view_lesson(or even be an alias for it).Should be based o nits view counterpart.
Should be configurable, e.g. if a school mandates that only the headmastership.
Should be configurable (not all schools want students to be ableto see their own records, unfortunately).
Should be configurable, as above.
Should be based on its view counterpart.
Should be based on its more general counterpart.
Should be based on its view counterpart.
Should be based on its view counterpart.
Should be based on its view counterpart.
Should be based on its view counterpart.
Should be based on its view counterpart.
Should be based on its view counterpart.
Why does this default to
True?changed this line in version 77 of the diff
changed this line in version 77 of the diff
changed this line in version 77 of the diff
added 1 commit
fe5e0576- Respect setting "view_own_personal_notes" on all placesCompare with previous version
changed this line in version 78 of the diff
added 1 commit
f57c83f3- Make configurable if primary group owners can register absences for their groupsCompare with previous version
@yuha Can you please check this?
changed this line in version 79 of the diff
changed this line in version 79 of the diff
changed this line in version 79 of the diff
changed this line in version 79 of the diff
changed this line in version 79 of the diff
changed this line in version 79 of the diff
changed this line in version 79 of the diff
changed this line in version 79 of the diff
changed this line in version 79 of the diff
changed this line in version 79 of the diff
changed this line in version 79 of the diff
changed this line in version 79 of the diff
changed this line in version 79 of the diff
added 1 commit
57be44f2- Include depending predicates in permission rules,Compare with previous version
changed this line in version 80 of the diff
added 1 commit
Compare with previous version
@nik Except one question, all threads in this MR are resolved now. Please continue with code review fastly!
This code block needs some commenting.
Moving these lines is an unrelated change.
This code block needs some commenting.
Is this intentionally hiding the
requestkwarg from the parent__init__and subsequent code?In which regard is this related to the permissions?
In which regard is this related to permissions?
Unrelated whitespace change
Unrelated whitespace change
Shouldn't this be a class method on LessonPeriod, or even a manager method?
What is an "Instance object"?
Please turn this around.
Always extend privileges starting from the minimum, never start with accessing everything and then reducing to the actual permission level.
Debug print!
gain, always make privilege escalation additive rather than substractive.
What about these open tasks?
Please remove
451cdb33a7from the history (and recreate it with a valid commiter ID).Maybe you can do this for us, as we are not so experienced with Git at all.
They are all done.
added 1 commit
9d6db523- Refactor "and" sequence using all()Compare with previous version
Yes, as the original class doesn't accept a request argument.
It won't work otherwise. If you merge https://edugit.org/AlekSIS/official/AlekSIS-App-Alsijil/-/merge_requests/95, there won't be a diff more longer. I just merged it a little bit earlier to this branch than to the master.
changed this line in version 82 of the diff
added 1 commit
0985aa3c- Remove debug printsCompare with previous version
changed this line in version 83 of the diff
added 2 commits
d1f104f9- Simplify request getter in forms5b288ced- Add some extra commenting in forms.pyCompare with previous version
See earlier comment to the same topic.
As this will have some very bad side effects (double commits etc.), we decided to keep this commit in the history and to make the creator responsible if this will have have side effects in the future.
changed this line in version 84 of the diff
added 1 commit
3d5d957c- Make permission checks in views.py additiveCompare with previous version
I don't think so because the function fits only a certain URL structure.
changed this line in version 85 of the diff
changed this line in version 85 of the diff
added 1 commit
31fed539- Rename get_instance_by_pk and document it betterCompare with previous version
changed this line in version 86 of the diff
added 1 commit
47ab315d- Fix defaults of some predicates (True to False) and catch side effect of this changeCompare with previous version
Should now fit.
resolved all threads
All threads resolved @nik.
unmarked as a Work In Progress
mentioned in commit
50db52549f