Resolve "Add permissions/rules" #22

Merged
yuha merged 14 commits from 9-add-permissions-rules into frontend 2024-10-05 14:05:10 +02:00
yuha commented 2024-10-02 18:57:50 +02:00 (Migrated from edugit.org)

Closes #9

Closes #9
yuha commented 2024-10-02 18:57:50 +02:00 (Migrated from edugit.org)

assigned to @yuha

assigned to @yuha
yuha commented 2024-10-02 20:25:13 +02:00 (Migrated from edugit.org)

mentioned in merge request !20

mentioned in merge request !20
yuha commented 2024-10-02 22:34:39 +02:00 (Migrated from edugit.org)

added 1 commit

  • 2f9de075 - Add basic permissions and rules

Compare with previous version

added 1 commit <ul><li>2f9de075 - Add basic permissions and rules</li></ul> [Compare with previous version](/AlekSIS/onboarding/AlekSIS-App-Maka/-/merge_requests/4/diffs?diff_id=48285&start_sha=24eecd84e91e7c492ddb0064a9240b06e1439a01)
yuha commented 2024-10-02 22:46:15 +02:00 (Migrated from edugit.org)

added 2 commits

  • 4352f1c3 - Rename create rule names in mutations
  • 1a7da7d4 - Add dynamically added permissions

Compare with previous version

added 2 commits <ul><li>4352f1c3 - Rename create rule names in mutations</li><li>1a7da7d4 - Add dynamically added permissions</li></ul> [Compare with previous version](/AlekSIS/onboarding/AlekSIS-App-Maka/-/merge_requests/4/diffs?diff_id=48287&start_sha=2f9de075c48c0d45269f0067e4ef7df0090d45c5)
yuha commented 2024-10-02 22:53:01 +02:00 (Migrated from edugit.org)

added 3 commits

  • 6f549d5e - Add basic permissions and rules
  • 70741b74 - Rename create rule names in mutations
  • e93567be - Add dynamically added permissions

Compare with previous version

added 3 commits <ul><li>6f549d5e - Add basic permissions and rules</li><li>70741b74 - Rename create rule names in mutations</li><li>e93567be - Add dynamically added permissions</li></ul> [Compare with previous version](/AlekSIS/onboarding/AlekSIS-App-Maka/-/merge_requests/4/diffs?diff_id=48289&start_sha=1a7da7d4d40095988d531e63db32404c43545796)
yuha commented 2024-10-02 23:45:11 +02:00 (Migrated from edugit.org)

added 1 commit

  • eb139148 - Add permission checks to queryset filtering in types

Compare with previous version

added 1 commit <ul><li>eb139148 - Add permission checks to queryset filtering in types</li></ul> [Compare with previous version](/AlekSIS/onboarding/AlekSIS-App-Maka/-/merge_requests/4/diffs?diff_id=48296&start_sha=e93567be9724f04126c199616480cf0ca8bbe47a)
yuha commented 2024-10-02 23:52:03 +02:00 (Migrated from edugit.org)

(kind of) needs https://edugit.org/AlekSIS/official/AlekSIS-Core/-/issues/1095 – otherwise non-admin group owners are not able to really manage grades

(kind of) needs https://edugit.org/AlekSIS/official/AlekSIS-Core/-/issues/1095 – otherwise non-admin group owners are not able to really manage grades
hansegucker commented 2024-10-03 00:39:25 +02:00 (Migrated from edugit.org)

Nearly finished ;-)

Nearly finished ;-)
yuha commented 2024-10-03 02:14:24 +02:00 (Migrated from edugit.org)

added 4 commits

  • 78d7c888 - Add permission checks to queryset filtering in types
  • 3469334c - Remove global permission checks for unsensitive models
  • 2c34edf3 - Actually allow for filtering grades & efforts by group ID as needed by group overview page
  • 9eca127e - Include subgroups in effort/grade query filtering

Compare with previous version

added 4 commits <ul><li>78d7c888 - Add permission checks to queryset filtering in types</li><li>3469334c - Remove global permission checks for unsensitive models</li><li>2c34edf3 - Actually allow for filtering grades &amp; efforts by group ID as needed by group overview page</li><li>9eca127e - Include subgroups in effort/grade query filtering</li></ul> [Compare with previous version](/AlekSIS/onboarding/AlekSIS-App-Maka/-/merge_requests/4/diffs?diff_id=48299&start_sha=eb139148ce2446237716c94915f0f73efec9c1c9)
yuha commented 2024-10-03 02:15:00 +02:00 (Migrated from edugit.org)

good! :D

good! :D
yuha commented 2024-10-03 02:15:14 +02:00 (Migrated from edugit.org)

update: this should be usable now (finally)

update: this should be usable now (finally)
yuha commented 2024-10-03 02:15:47 +02:00 (Migrated from edugit.org)

TODO: respect perms in frontend (disable fields on read only permissions etc)

TODO: respect perms in frontend (disable fields on read only permissions etc)
yuha commented 2024-10-03 02:16:02 +02:00 (Migrated from edugit.org)

TODO: check for/discuss student perspective

TODO: check for/discuss student perspective
yuha commented 2024-10-03 02:16:14 +02:00 (Migrated from edugit.org)

resolved all threads

resolved all threads
yuha commented 2024-10-03 02:16:51 +02:00 (Migrated from edugit.org)

@hansegucker would be great if you could do some testing tomorrow!

@hansegucker would be great if you could do some testing tomorrow!
hansegucker commented 2024-10-03 16:02:53 +02:00 (Migrated from edugit.org)

Why is shared secret needed for managing grade sets and effort types

Why is shared secret needed for managing grade sets and effort types
hansegucker commented 2024-10-03 16:28:29 +02:00 (Migrated from edugit.org)
        return user.person in obj.group.members.all()
```suggestion:-0+0 return user.person in obj.group.members.all() ```
hansegucker commented 2024-10-03 16:28:29 +02:00 (Migrated from edugit.org)
        return user.person in obj.group.owners.all() or obj.group.parent_groups.filter(owners=user.person).exists()
```suggestion:-0+0 return user.person in obj.group.owners.all() or obj.group.parent_groups.filter(owners=user.person).exists() ```
hansegucker commented 2024-10-03 16:28:30 +02:00 (Migrated from edugit.org)
        permissions = ("maka.create_gradechoice_rule",)
```suggestion:-0+0 permissions = ("maka.create_gradechoice_rule",) ```
hansegucker commented 2024-10-03 16:28:30 +02:00 (Migrated from edugit.org)
        permissions = ("maka.create_gradeset_rule",)
```suggestion:-0+0 permissions = ("maka.create_gradeset_rule",) ```
hansegucker commented 2024-10-03 16:28:30 +02:00 (Migrated from edugit.org)
        permissions = ("maka.create_grade_rule",)
```suggestion:-0+0 permissions = ("maka.create_grade_rule",) ```
hansegucker commented 2024-10-03 16:28:30 +02:00 (Migrated from edugit.org)

Use super().get_queryset() as shared secret check won't work otherwise.

Use `super().get_queryset()` as shared secret check won't work otherwise.
hansegucker commented 2024-10-03 16:28:30 +02:00 (Migrated from edugit.org)

Use super().get_queryset() as shared secret check won't work otherwise.

Use `super().get_queryset()` as shared secret check won't work otherwise.
hansegucker commented 2024-10-03 16:28:30 +02:00 (Migrated from edugit.org)

Use super().get_queryset() as shared secret check won't work otherwise.

Use `super().get_queryset()` as shared secret check won't work otherwise.
hansegucker commented 2024-10-03 16:28:30 +02:00 (Migrated from edugit.org)
        permissions = ("maka.create_efforttype_rule",)
```suggestion:-0+0 permissions = ("maka.create_efforttype_rule",) ```
hansegucker commented 2024-10-03 16:28:30 +02:00 (Migrated from edugit.org)
        permissions = ("maka.create_effort_rule",)
```suggestion:-0+0 permissions = ("maka.create_effort_rule",) ```
hansegucker commented 2024-10-03 16:28:30 +02:00 (Migrated from edugit.org)

This is probably wrong. With this check, a user would be able to see the grades of all the groups he is a member of. Instead include an or in the queryset.filter at the end checking for the person attribute.

This is probably wrong. With this check, a user would be able to see the grades of all the groups he is a member of. Instead include an or in the `queryset.filter` at the end checking for the person attribute.
hansegucker commented 2024-10-03 16:28:31 +02:00 (Migrated from edugit.org)
add_perm("maka.create_effort_rule", add_effort_predicate)

and so on

```suggestion:-0+0 add_perm("maka.create_effort_rule", add_effort_predicate) ``` and so on
hansegucker commented 2024-10-03 16:28:31 +02:00 (Migrated from edugit.org)

Separate into fetch and view permission (AS EVERYWHERE ELSE).

This is fetch_gradesets_rule

Separate into fetch and view permission (AS EVERYWHERE ELSE). This is `fetch_gradesets_rule`
hansegucker commented 2024-10-03 16:28:31 +02:00 (Migrated from edugit.org)

This is view_gradesets_rule

This is `view_gradesets_rule`
hansegucker commented 2024-10-03 16:28:31 +02:00 (Migrated from edugit.org)

as above

as above
hansegucker commented 2024-10-03 16:28:31 +02:00 (Migrated from edugit.org)

as above

as above
yuha commented 2024-10-04 15:13:16 +02:00 (Migrated from edugit.org)

added 1 commit

  • 01b96b63 - Remove shared secret check from grade set and effort type types/mutations/pages

Compare with previous version

added 1 commit <ul><li>01b96b63 - Remove shared secret check from grade set and effort type types/mutations/pages</li></ul> [Compare with previous version](/AlekSIS/onboarding/AlekSIS-App-Maka/-/merge_requests/4/diffs?diff_id=48355&start_sha=9eca127e68c59d2f3d94de43c1425186b518c195)
yuha commented 2024-10-04 15:13:20 +02:00 (Migrated from edugit.org)

removed

removed
yuha commented 2024-10-04 15:13:50 +02:00 (Migrated from edugit.org)

changed this line in version 7 of the diff

changed this line in [version 7 of the diff](/AlekSIS/onboarding/AlekSIS-App-Maka/-/merge_requests/4/diffs?diff_id=48357&start_sha=01b96b633b52928c444b3727043ba51b27de4537#fa304ec9f5bf8fc2591e1ddb4af7331dde4df5a0_20_20)
yuha commented 2024-10-04 15:13:50 +02:00 (Migrated from edugit.org)

changed this line in version 7 of the diff

changed this line in [version 7 of the diff](/AlekSIS/onboarding/AlekSIS-App-Maka/-/merge_requests/4/diffs?diff_id=48357&start_sha=01b96b633b52928c444b3727043ba51b27de4537#fa304ec9f5bf8fc2591e1ddb4af7331dde4df5a0_32_32)
yuha commented 2024-10-04 15:13:51 +02:00 (Migrated from edugit.org)

added 1 commit

  • f88817ba - Apply 2 suggestion(s) to 1 file(s)

Compare with previous version

added 1 commit <ul><li>f88817ba - Apply 2 suggestion(s) to 1 file(s)</li></ul> [Compare with previous version](/AlekSIS/onboarding/AlekSIS-App-Maka/-/merge_requests/4/diffs?diff_id=48357&start_sha=01b96b633b52928c444b3727043ba51b27de4537)
yuha commented 2024-10-04 15:17:58 +02:00 (Migrated from edugit.org)

changed this line in version 8 of the diff

changed this line in [version 8 of the diff](/AlekSIS/onboarding/AlekSIS-App-Maka/-/merge_requests/4/diffs?diff_id=48359&start_sha=f88817baeb6c641811d7c78524c4a82169f3fc6e#f8b118ae331b058b12c6a6bd3f752fe3f60412ff_83_83)
yuha commented 2024-10-04 15:17:58 +02:00 (Migrated from edugit.org)

changed this line in version 8 of the diff

changed this line in [version 8 of the diff](/AlekSIS/onboarding/AlekSIS-App-Maka/-/merge_requests/4/diffs?diff_id=48359&start_sha=f88817baeb6c641811d7c78524c4a82169f3fc6e#f8b118ae331b058b12c6a6bd3f752fe3f60412ff_43_43)
yuha commented 2024-10-04 15:17:58 +02:00 (Migrated from edugit.org)

changed this line in version 8 of the diff

changed this line in [version 8 of the diff](/AlekSIS/onboarding/AlekSIS-App-Maka/-/merge_requests/4/diffs?diff_id=48359&start_sha=f88817baeb6c641811d7c78524c4a82169f3fc6e#1624b422ab6231b0e4a5ff69135bd1fe8d52f3cb_59_59)
yuha commented 2024-10-04 15:17:58 +02:00 (Migrated from edugit.org)

changed this line in version 8 of the diff

changed this line in [version 8 of the diff](/AlekSIS/onboarding/AlekSIS-App-Maka/-/merge_requests/4/diffs?diff_id=48359&start_sha=f88817baeb6c641811d7c78524c4a82169f3fc6e#6951e25a2130c8f1fddf8d8dd6510338809aa5c9_48_48)
yuha commented 2024-10-04 15:17:58 +02:00 (Migrated from edugit.org)

changed this line in version 8 of the diff

changed this line in [version 8 of the diff](/AlekSIS/onboarding/AlekSIS-App-Maka/-/merge_requests/4/diffs?diff_id=48359&start_sha=f88817baeb6c641811d7c78524c4a82169f3fc6e#6951e25a2130c8f1fddf8d8dd6510338809aa5c9_109_109)
yuha commented 2024-10-04 15:17:59 +02:00 (Migrated from edugit.org)

changed this line in version 8 of the diff

changed this line in [version 8 of the diff](/AlekSIS/onboarding/AlekSIS-App-Maka/-/merge_requests/4/diffs?diff_id=48359&start_sha=f88817baeb6c641811d7c78524c4a82169f3fc6e#edd7084fd319086389578e80f9b50ffc27ccefeb_38_38)
yuha commented 2024-10-04 15:17:59 +02:00 (Migrated from edugit.org)

added 1 commit

Compare with previous version

added 1 commit <ul><li>75681d41 - Rename rules</li></ul> [Compare with previous version](/AlekSIS/onboarding/AlekSIS-App-Maka/-/merge_requests/4/diffs?diff_id=48359&start_sha=f88817baeb6c641811d7c78524c4a82169f3fc6e)
yuha commented 2024-10-04 15:19:42 +02:00 (Migrated from edugit.org)

added 1 commit

  • 9ec6b33d - Fix get_queryset with shared secret mixin

Compare with previous version

added 1 commit <ul><li>9ec6b33d - Fix get_queryset with shared secret mixin</li></ul> [Compare with previous version](/AlekSIS/onboarding/AlekSIS-App-Maka/-/merge_requests/4/diffs?diff_id=48361&start_sha=75681d41b3e0692c364b03921a3a34349377491d)
yuha commented 2024-10-04 15:36:32 +02:00 (Migrated from edugit.org)

changed this line in version 10 of the diff

changed this line in [version 10 of the diff](/AlekSIS/onboarding/AlekSIS-App-Maka/-/merge_requests/4/diffs?diff_id=48363&start_sha=9ec6b33d623c85ab54c7b46a8a7cca9be1f85000#1624b422ab6231b0e4a5ff69135bd1fe8d52f3cb_49_52)
yuha commented 2024-10-04 15:36:33 +02:00 (Migrated from edugit.org)

added 1 commit

  • 39d0aa7c - Fix permission filtering for viewing own grades

Compare with previous version

added 1 commit <ul><li>39d0aa7c - Fix permission filtering for viewing own grades</li></ul> [Compare with previous version](/AlekSIS/onboarding/AlekSIS-App-Maka/-/merge_requests/4/diffs?diff_id=48363&start_sha=9ec6b33d623c85ab54c7b46a8a7cca9be1f85000)
yuha commented 2024-10-05 01:18:15 +02:00 (Migrated from edugit.org)

changed this line in version 11 of the diff

changed this line in [version 11 of the diff](/AlekSIS/onboarding/AlekSIS-App-Maka/-/merge_requests/4/diffs?diff_id=48378&start_sha=39d0aa7c04f83824fd7bd3747c8045668f3c89f1#edd7084fd319086389578e80f9b50ffc27ccefeb_95_94)
yuha commented 2024-10-05 01:18:15 +02:00 (Migrated from edugit.org)

changed this line in version 11 of the diff

changed this line in [version 11 of the diff](/AlekSIS/onboarding/AlekSIS-App-Maka/-/merge_requests/4/diffs?diff_id=48378&start_sha=39d0aa7c04f83824fd7bd3747c8045668f3c89f1#edd7084fd319086389578e80f9b50ffc27ccefeb_110_110)
yuha commented 2024-10-05 01:18:16 +02:00 (Migrated from edugit.org)

changed this line in version 11 of the diff

changed this line in [version 11 of the diff](/AlekSIS/onboarding/AlekSIS-App-Maka/-/merge_requests/4/diffs?diff_id=48378&start_sha=39d0aa7c04f83824fd7bd3747c8045668f3c89f1#edd7084fd319086389578e80f9b50ffc27ccefeb_114_114)
yuha commented 2024-10-05 01:18:16 +02:00 (Migrated from edugit.org)

changed this line in version 11 of the diff

changed this line in [version 11 of the diff](/AlekSIS/onboarding/AlekSIS-App-Maka/-/merge_requests/4/diffs?diff_id=48378&start_sha=39d0aa7c04f83824fd7bd3747c8045668f3c89f1#edd7084fd319086389578e80f9b50ffc27ccefeb_128_128)
yuha commented 2024-10-05 01:18:16 +02:00 (Migrated from edugit.org)

added 1 commit

  • 980c5cee - Separate fetch and view rules

Compare with previous version

added 1 commit <ul><li>980c5cee - Separate fetch and view rules</li></ul> [Compare with previous version](/AlekSIS/onboarding/AlekSIS-App-Maka/-/merge_requests/4/diffs?diff_id=48378&start_sha=39d0aa7c04f83824fd7bd3747c8045668f3c89f1)
yuha commented 2024-10-05 01:18:28 +02:00 (Migrated from edugit.org)

resolved all threads

resolved all threads
yuha commented 2024-10-05 01:18:36 +02:00 (Migrated from edugit.org)

assigned to @hansegucker and unassigned @yuha

assigned to @hansegucker and unassigned @yuha
yuha commented 2024-10-05 01:18:41 +02:00 (Migrated from edugit.org)

marked this merge request as ready

marked this merge request as **ready**
yuha commented 2024-10-05 01:23:57 +02:00 (Migrated from edugit.org)

added 1 commit

Compare with previous version

added 1 commit <ul><li>b9a63416 - Reformat</li></ul> [Compare with previous version](/AlekSIS/onboarding/AlekSIS-App-Maka/-/merge_requests/4/diffs?diff_id=48380&start_sha=980c5cee5504233d8d56f1355cbd662576d18081)
hansegucker commented 2024-10-05 14:05:10 +02:00 (Migrated from edugit.org)

mentioned in commit a56a2fc6dd

mentioned in commit a56a2fc6dd4a78dd83f0a80c2c04dbe25a4fff43
hansegucker (Migrated from edugit.org) merged commit a56a2fc6dd into frontend 2024-10-05 14:05:10 +02:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
aleksis/AlekSIS-App-Maka!22
No description provided.