Skip to content
This repository was archived by the owner on Sep 25, 2025. It is now read-only.
This repository was archived by the owner on Sep 25, 2025. It is now read-only.

Client side permissions #1435

Open
Open

Description

@ojeytonwilliams

How do we want to handle situations where the client needs to know what permissions the current user has? The current implementation is to add the list of admined_chapters to the meQuery, but really that's just the list of chapters for which they have Permission.ChapterEdit.

This works for the MVP, since the only chapter level role is the administrator, so if you have any Chapter Permission you have them all. However, this will break down post-MVP when we add more roles with fewer permissions.

Two obvious approaches:

  1. Keep adding to fields the meQuery result (chapters_with_event_create and so on)
  2. Return all the chapter_user data for that user, so the client can work it out

I'm leaning towards 2. right now.

Activity

  1. added
    Discussion
    on Aug 22, 2022
  2. gikf commented on Aug 22, 2022

    @gikf
    Member

    The most straightforward, but repeating might be adding separate queries, or single query with argument which permission should be used as filtering condition.

  3. ojeytonwilliams commented on Aug 23, 2022

    @ojeytonwilliams
    ContributorAuthor

    single query with argument which permission should be used as filtering condition.

    If we're just going to use the meQuery I don't think we want to start calling it with arguments.

  4. gikf commented on Aug 23, 2022

    @gikf
    Member

    Definitely, I didn't mean the meQuery, new separate, or new single query, I should have been more precise. Both means also dropping the admined_chapters from meQuery.

  5. ojeytonwilliams commented on Aug 23, 2022

    @ojeytonwilliams
    ContributorAuthor

    True, that's a reasonable option. It makes the dashboard a bit slower (one more round-trip), but that's not a deal-breaker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    APIDiscussion

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions