Permit owners, admins and moderators, rather than the group's creator, to edit a group. The creator can't edit the group unless they happen to also be an owner, admin or moderator (creators of groups will be owners unless they've subsequently left the group or changed roles).
This allows owners, admins and moderators to call the edit-group API, to see the "edit group" link on the group's page, and to view the edit-group page.
Testing
Create a group and visit the group's page. As the owner of the group you should see the Edit group link. Click on the link and check that you can edit the group.
Log out and visit the group's edit page to test that an unauthenticated user can't edit a group: you should get a 404.
Log in as another user and visit the group's edit page to check that a non-member can't edit a group.
Join the group and visit the group's edit page to check that a plain member can't edit a group.
Promote the user to moderator or admin and check that now they can edit the group.
This has to be done in SQL, for example:
update user_group set roles = '["admin"]'::jsonb where id = 42;
Permit owners, admins and moderators, rather than the group's creator, to edit a group. The creator can't edit the group unless they happen to also be an owner, admin or moderator (creators of groups will be owners unless they've subsequently left the group or changed roles).
This allows owners, admins and moderators to call the edit-group API, to see the "edit group" link on the group's page, and to view the edit-group page.
Testing
Create a group and visit the group's page. As the owner of the group you should see the Edit group link. Click on the link and check that you can edit the group.
Log out and visit the group's edit page to test that an unauthenticated user can't edit a group: you should get a 404.
Log in as another user and visit the group's edit page to check that a non-member can't edit a group.
Join the group and visit the group's edit page to check that a plain member can't edit a group.
Promote the user to moderator or admin and check that now they can edit the group.
This has to be done in SQL, for example: