Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Make UI understand user rights in suborganizations #532

Open
Rikuoja opened this issue Mar 13, 2020 · 1 comment
Open

Make UI understand user rights in suborganizations #532

Rikuoja opened this issue Mar 13, 2020 · 1 comment

Comments

@Rikuoja
Copy link
Contributor

Rikuoja commented Mar 13, 2020

Currently, the UI only checks the admin organizations of the user when determining whether editing an event is allowed, or whether events are displayed on the main page.

The API, however, does allow the user to edit suborganization events, but the UI currently doesn't know that, and no such cases have been needed thus far.

However, if need arises,

  1. https://github.com/City-of-Helsinki/linkedevents-ui/blob/master/src/utils/checkEventEditability.js#L28 should be changed to allow editing suborganization events.

This would require some API work to give the UI information on which organization events may be edited, or, preferably, returning user_may_edit or similar boolean in the API per event. This way, UI and API would always be in agreement on which events may be edited.

  1. https://github.com/City-of-Helsinki/linkedevents-ui/blob/master/src/views/EventListing/index.js#L210 should be changed so that the API returns all events the user may edit, not only those in user admin organizations.
@Rikuoja
Copy link
Contributor Author

Rikuoja commented Mar 13, 2020

This would probably require adding a check box in event listing for "Display my own events/Display events in my organization(s)/Display events in all suborganizations", for the main page to remain legible.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant