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

Normal users can join groups bypassing approval process using REST API #530

Open
kazlauskis opened this issue Jan 29, 2025 · 1 comment
Open

Comments

@kazlauskis
Copy link
Member

Non-admin users can only add themselves to public groups; requests to join by-request groups will result in the user being flagged as pending

Joining a request-only group currently automatically approves the membership. e.g:

POST https://warehouse1.indicia.org.uk/index.php/services/rest/groups/3059/users

{
  "values": {
    "id": 282375
  }
}

I can see the membership is approved on the https://irecord.org.uk/activities/pending?group_id=3059

If the user joins using the invite link https://irecord.org.uk/join/senamiestis, then the membership is correctly pending.

@kazlauskis
Copy link
Member Author

Another important improvement would be to include the "pending" status in the REST responses, since currently there is no way to detect the user has a pending membership using REST.

GET https://warehouse1.indicia.org.uk/index.php/services/rest/groups

[
    {
        "values": {
            "id": "3059",
            "title": "Senamiestis",
            "description": "Test group",
            "joining_method": "R",
            "website_id": "23",
            "group_type_id": "4845",
            "from_date": null,
            "to_date": null,
            "created_on": "2025-01-29T08:01:04+00:00",
            "created_by_id": "71394",
            "indexed_location_ids": null,
            "group_type": "Local groups"
            "pending": true <- add something like this
        }
    }
]

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

No branches or pull requests

1 participant