fix: OIDC teams should not have admins #2161
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "waza-ari/vikunja:fix-no-oidc-team-no-admin"
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?
This PR fixes an issue discussed in #2152. Before this PR, the user who triggered team creation automatically got the admin flag set for this group, which makes perfect sense for the normal UI workflow. OIDC managed teams cannot be edited in Vikunja, and they're created automatically by the first user logging in having this team assigned. This PR therefore makes sure that OIDC managed team members do not receive the admin flag.
Hi waza-ari!
Thank you for creating a PR!
I've deployed the frontend changes of this PR on a preview environment under this URL: https://2161-fix-no-oidc-team-no-admin--vikunja-frontend-preview.netlify.app
You can use this url to view the changes live and test them out.
You will need to manually connect this to an api running somewhere. The easiest to use is https://try.vikunja.io/.
This preview does not contain any changes made to the api, only the frontend.
Have a nice day!
@ -214,0 +216,4 @@
// If def_adm is true, the user will be an admin of the team
// Note: this function has been extracted from the Create method to allow
// an additional parameter to control whether the user should become admin of the team
func (t *Team) CreateNewTeam(s *xorm.Session, a web.Auth, adm bool) (err error) {
Please rename the
adm
parameter to something likefirstUserShouldBeAdmin
so that it's clear what it does.@ -314,4 +332,1 @@
return err
}
return events.Dispatch(&TeamCreatedEvent{
Can you include the event dispatch in the new method as well?
Absolutely. I'm not sure how braindead I was to think that its a good idea to leave it there...
No worries!