Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow groups with no scopes in admin pages #9011

Merged
merged 1 commit into from
Oct 11, 2024

Conversation

seanh
Copy link
Contributor

@seanh seanh commented Oct 11, 2024

Problem

Previously the only way to create open or restricted groups was via the
https://hypothes.is/admin/groups/new admin page and that page forced you
to enter at least one scope for the group.

It's now possible to use the https://hypothes.is/groups/new page to
create open and restricted groups with no scopes.

But the https://hypothes.is/admin/groups/<PUBID> page for editing an
existing open or restricted group forces the group to have at least one
scope.

This means that if you create an unscoped group via
https://hypothes.is/groups/new and then try to edit the group via
https://hypothes.is/admin/groups/<PUBID> it'll force you to enter at
least one scope for the group before you can save any changes (even to
other fields, e.g. the group's name).

Solution

Remove the admin pages validation requirement that groups must have at
least one scope. Now you can edit unscoped groups without having to add
a scope to them.

As a side-effect https://hypothes.is/admin/groups/new can now be used to
create unscoped groups as well.

Testing

Go to either https://hypothes.is/admin/groups/new or
https://hypothes.is/groups/new, create an open or restricted group, then
go to https://hypothes.is/admin/groups/<PUBID> and edit the group
without adding any scopes to it.

Base automatically changed from fix-admin-pages to main October 11, 2024 15:57
Problem
-------

Previously the only way to create open or restricted groups was via the
https://hypothes.is/admin/groups/new admin page and that page forced you
to enter at least one scope for the group.

It's now possible to use the https://hypothes.is/groups/new page to
create open and restricted groups with no scopes.

But the `https://hypothes.is/admin/groups/<PUBID>` page for editing an
existing open or restricted group forces the group to have at least one
scope.

This means that if you create an unscoped group via
https://hypothes.is/groups/new and then try to edit the group via
`https://hypothes.is/admin/groups/<PUBID>` it'll force you to enter at
least one scope for the group before you can save any changes (even to
other fields, e.g. the group's name).

Solution
--------

Remove the admin pages validation requirement that groups must have at
least one scope. Now you can edit unscoped groups without having to add
a scope to them.

As a side-effect https://hypothes.is/admin/groups/new can now be used to
create unscoped groups as well.

Testing
-------

Go to either https://hypothes.is/admin/groups/new or
https://hypothes.is/groups/new, create an open or restricted group, then
go to `https://hypothes.is/admin/groups/<PUBID>` and edit the group
without adding any scopes to it.
@seanh seanh force-pushed the admin-pages-allow-unscoped-groups branch from 9691a65 to c178e3e Compare October 11, 2024 15:57
@seanh seanh merged commit b08f392 into main Oct 11, 2024
8 checks passed
@seanh seanh deleted the admin-pages-allow-unscoped-groups branch October 11, 2024 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants