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

PlaceCal Norwich's Organiser should have the proper set of permissions #2062

Closed
14 tasks done
Tracked by #2086
kimadactyl opened this issue Sep 19, 2023 — with Huly for GitHub · 12 comments
Closed
14 tasks done
Tracked by #2086
Labels
eee Enormous Extra Effort (I have no idea how or needs breaking down) verified Issues that have been user acceptance tested vvv Very Very Valuable

Comments

Copy link
Member

kimadactyl commented Sep 19, 2023

User story

As PlaceCal Norwich's Organiser (PNO), I should only have access to relevant data and actions related to my role.

This should form the basis for a generic "new neighbourhood" type of user. It does not cover adding people to existing areas.

Acceptance criteria

  • PNO has permissions "citizen" and "neighbourhood_admin: norwich" and "site_admin for PlaceCal Norwich" and nothing else

In the admin interface, PNO can:

PNO cannot:

Implementation notes & questions

Implementation plan

To be written by the developer

@kimadactyl kimadactyl added this to the Security issues we can fix milestone Sep 19, 2023
@kimadactyl kimadactyl changed the title PlaceCal Norwich's Commissioner should have the proper set of permissions WIP: PlaceCal Norwich's Commissioner should have the proper set of permissions Sep 19, 2023
@kimadactyl
Copy link
Member Author

Prob this list needs a bit of a discussion

@kimadactyl kimadactyl changed the title WIP: PlaceCal Norwich's Commissioner should have the proper set of permissions WIP: PlaceCal Norwich's Organiser should have the proper set of permissions Sep 20, 2023
@r-ferrier
Copy link
Contributor

Things that a site_admin in charge of a place based site can edit:

  • name
  • place name
  • tagline
  • hero
  • description
  • published?
  • theme
  • logo, footer, other image things like credit
  • badge zoom level

Things they should not have

  • site admin assignation
  • other neighbourhoods to include
  • other neighbourhood info

@kimadactyl kimadactyl changed the title WIP: PlaceCal Norwich's Organiser should have the proper set of permissions PlaceCal Norwich's Organiser should have the proper set of permissions Sep 20, 2023
@kimadactyl
Copy link
Member Author

Just noting theres more fields than that they shouldnt have - the should list looks correct tho :)

@kimadactyl kimadactyl added vvv Very Very Valuable eee Enormous Extra Effort (I have no idea how or needs breaking down) and removed needs triage labels Sep 20, 2023
@ivan-kocienski-gfsc
Copy link
Contributor

meeting notes:

trying to not think about how non-root users can create other non root users as this is pretty complex and needs more thought.

@ivan-kocienski-gfsc
Copy link
Contributor

Note: users cannot remove (TD) partnership tags as this will push things out of their scope

@kimadactyl
Copy link
Member Author

kimadactyl commented Oct 24, 2023

Create users assigned to partners in Norwich

I think this already works though? If not fine to remove but it's my understanding this is working and just needs confirming / tests writing for it

Note: users cannot remove (TD) partnership tags as this will push things out of their scope

Wrong ticket?

@ivan-kocienski-gfsc
Copy link
Contributor

ivan-kocienski-gfsc commented Oct 24, 2023

Notes on Acceptance criteria

  • PNO has permissions "citizen" (given a user with a citizen role)
  • PNO is set as neighbourhood_admin: norwich (has one neighbourhood, norwich)
  • PNO is set as site_admin for PlaceCal Norwich (has one site, norwich site)

In the admin interface, PNO can:

  • CRUD only partners in Norwich (including adding categories and facilities tags)
    • can only see partners in norwich (find partners scope in controller)
    • validates that the partners' address or service area are all in norwich
    • can only add norwich neighbourhoods (or descendants of)
    • cannot remove non norwich neighbourhoods
    • but they can add/remove any category or facility (?)
  • CRUD only calendars attached to partners in Norwich
    • add a controller filter that scopes calendars to (partners in neighbourhood)
    • validation of this as well
    • their default location AND partner must be in users allocation
  • See users who are partner_admin of partners in Norwich
    • filter scope the users controller to only users with partners in norwich
    • would feel better if this was its own view/controller
    • maybe a view showing a user with all their sites / partners
  • Create users assigned to partners in Norwich decided out of scope for this cycle 24.10.23 HA
  • Assign existing users to partners in Norwich
    • does this contradict the earlier spec where a user can only see users who manage partners in their neighbourhood?
  • Configure key info about the Norwich PlaceCal site (homepage information on norwich.placecal.org including logos etc.)
    • if the user is a site_admin for norwich site then they can already do this

PNO cannot:

  • CRUD any partners outside Norwich

    • verify validations on partner model
  • CRUD any calendars not attached to Norwich partners

    • much trickier.
  • Delete users

    • only root can do this
  • Edit users

    • only root can do this
  • Do anything with partnerships

    • user cannot apply/remove partnership tags to partners
  • Have anything to do with news articles decided out of scope for this cycle 24.10.23 HA

  • Edit anything about a neighbourhood

    • only root should be able to do this.
  • Cannot remove their site or neighbourhood (?)

I think the hardest thing may be having a user edit a partner that has neighbourhoods outside of their allocation and saving the partner without modifying the outside-of-allocation neighbourhoods whilst still letting them add/remove neighbourhoods within their allocation.

@r-ferrier
Copy link
Contributor

Me and @aaaaargZombies had a big chat about this this morning and broken down the ticket into smaller bits of work.

Everything we think(!) is straightforward has been ticketed, the only outstanding thing is how do neighbourhood admins attach users to partners:

  • At the moment, they can only see partners in their neighbourhood, so they cannot make anyone an admin unless they are already in the neighbourhood
  • We think it would be most logical to look into allowing them to create a user, which can only be created if it is also made partner admin of one of their partners at the same time

@kimadactyl
Copy link
Member Author

Could we make a new enum/bool for users that's a global admin role called "user admin" or something like that, and then kick it back to another day?

(prob ditto editor, it doesnt make the most sense to have that in the same enum as root)

@r-ferrier
Copy link
Contributor

closing as all fixed! Verified in all the related tickets.

@r-ferrier r-ferrier added the verified Issues that have been user acceptance tested label Nov 14, 2023
@kimadactyl
Copy link
Member Author

Just noting it's all done - apart from the top checkbox which is kinda the most important one :D

I'll set it now

@katjam
Copy link
Member

katjam commented Nov 20, 2023

Verifed in production correct user settings:

image

image

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
eee Enormous Extra Effort (I have no idea how or needs breaking down) verified Issues that have been user acceptance tested vvv Very Very Valuable
Projects
None yet
Development

No branches or pull requests

4 participants