rropen / absense-planner

Planner tool for team absences
14 stars 11 forks source link

AP (& TA): Check and remove lingering perms when a team is deleted or disbanded #350

Open Jayden876212 opened 3 months ago

Jayden876212 commented 3 months ago

RRSwitchPermissionIssueRoadmapV2WithIDs

The logic for automatically removing permissions when a user leaves a team was added with the completion of issue #175, but it does not trigger when a team is deleted/disbanded.

Jayden876212 commented 3 months ago

To implement this, #175 would have to be implemented first.

https://github.com/rropen/absense-planner/blob/9cb1ab09322e6a43eb4d8de861ca64f15aa864f6/ap_src/ap_app/utils/switch_permissions.py#L7-L43

You could loop over the members of the team before it was disbanded and pass through each of their usernames to the function above.

Jayden876212 commented 3 months ago

This could be done in conjunction with the implementation of #349 in the TA.

Jayden876212 commented 3 months ago

It could also be implemented purely in the front-end of the AP using JS.

https://github.com/rropen/absense-planner/blob/9cb1ab09322e6a43eb4d8de861ca64f15aa864f6/ap_src/ap_app/static/js/teams.js#L97-L112

This is the function for deleting a team in JS. You can get the members of the team by querying the TA API.