You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 25, 2025. It is now read-only.
Repository navigation
This repository was archived by the owner on Sep 25, 2025. It is now read-only.
Auth: As an owner or chapter admin I can create events and set their venue type, venue, video url, tags and capacity. #270
Hey @madaleneaza-design how is the design for this coming along? I was thinking about building the api for this tomorrow, and also doing a skeleton in react for this, so if you already have something I'd like to implement that
changed the title [-]UI: As an organizer I can create events and set their location, tags and capacity.[/-][+]As an organizer I can create events and set their location, tags and capacity.[/+]on Feb 11, 2020
We don't have a more granular issue for implementing specific form fields to show/hide other venue or video URL (events.video_url). field based on the type of event, so for now this issue / user story could cover the form fields on the event creation page.
changed the title [-]As an organizer I can create events and set their location, tags and capacity.[/-][+]As an organizer I can create events and set their location, venue type, video url, tags and capacity.[/+]on Oct 27, 2020
changed the title [-]As an organizer I can create events and set their location, venue type, video url, tags and capacity.[/-][+]As an organizer I can create events and set their venue type, venue, video url, tags and capacity.[/+]on Oct 27, 2020
@KatieN I'm copying the authorization notes for CRUD an event here since they are relevant to this user story.
(via Discord) I don't think we have the permissions logic entirely figured out yet, but the ability for a user to post events on 1 or more chapters will depend on their authorization.
Authorization will come from either of
user_chapter_roles with possible role values organizer, member. A user can have 0 or more roles per chapter.
user_instance_roles with possible role values owner, administrator
Lots of earlier discussion on this issue led to this summary #296 (comment) which was then closed via PR: #335
A user with the role of owner or administrator would be able to CRUD events for all chapters in the instance and we infer that from their role in user_instance_roles and any event.chapter_id values would be from a drop-down field that populated with all values from the chapters table.
An organizer would be a user with specific authorization role entries via the user_chapter_roles table. They would have 1 or more such roles previously granted by the administrator or owner. The user_instance_roles.chapter_id values would be joined to the chapters table to populate a form field (drop-down) of possible values for events.chapter_id when an organizer creates or updates an event. Or, in the case the organizer only has authorization to a single chapter, then perhaps the app logic forces the events.chapter_id to that specific chapter_id
changed the title [-]As an organizer I can create events and set their venue type, venue, video url, tags and capacity.[/-][+]As an organizer, owner, or admin I can create events and set their venue type, venue, video url, tags and capacity.[/+]on Nov 7, 2020
Imagine, the file gets moved to another place. Or updated. The image you referenced to wouldn't be the image you had in mind (but the recent one - if at all), because you're pointing to master. I'm pointing to the same image at the point of commit, i.e. a fixed point in time.
In case you want to learn how I get there, I left the hint (pressing y on your keyboard. More shortcuts at ?), since I realised, that these are often unknown to GitHub users.
A fair point. For this issue, it was more of a side note that the schema needs work like we have open in #54. We have needed to pay attention to that issue in the docs, so I'll do better to keep it in mind on comments depending on if it matters in the context. THanks
Also, we now expect to have user_instance_roles, user_chapter_roles, and user_event_roles, which adds to the earlier conversation in this issue about these "role" tables.
Conversely, non-role / non-authorization based fields will exist in tables like user_chapter_details, user_event_details, and perhaps even user_instance_details.
This conversation is relevant to other MVP issues, but this issue references multiple roles. So, here's a primer to get the conversation seeded for whenever we get to thinking about authorization and defining permissions for the roles.
Isolating the user_%_roles tables from the user_%_details tables should keep the code less complex and less prone to accidentally allowing a user or bad actor to escalate their own role
This is just a rough start, but here's and idea of relatively simple logic that limits access to role tables only to those roles who should need them.
the owner is the only role / user who can CRUD to user_instance_roles
the owner and administratorsroles may CRUD any records in the user_chapter_roles table (this may be up for debate if for post-MVP if we see that "regional" administrators are needed for managing only a subset of chapters)
the organizer role may have some limited CRUD in the user_event_roles table for events within chapters granted via user_chapter_roles
the organizer role may only CRUD in the user_event_details table for chapters they are granted via user_chapter_roles
the user role may only update their own records in the user_chapter_details and user_event_details table (and user_instance_details if we end up adding a table for that purpose)
changed the title [-]As an organizer, owner, or admin I can create events and set their venue type, venue, video url, tags and capacity.[/-][+]Auth: As an owner or chapter admin I can create events and set their venue type, venue, video url, tags and capacity.[/+]on May 13, 2022
I know Oliver has a good handle on the auth and roles, but there are notable earlier links in the comments on this thread, on #743 (comment) and possible more on #273
Activity
Zeko369 commentedon Dec 14, 2019
Hey @madaleneaza-design how is the design for this coming along? I was thinking about building the api for this tomorrow, and also doing a skeleton in react for this, so if you already have something I'd like to implement that
[-]UI: As an organizer I can create events and set their location, tags and capacity.[/-][+]As an organizer I can create events and set their location, tags and capacity.[/+]allella commentedon Oct 27, 2020
Venue Type is an addition field discussed in
#378
and
#382
allella commentedon Oct 27, 2020
@KatieN
#270 is a relevant user story for the UI side.
We don't have a more granular issue for implementing specific form fields to show/hide other venue or video URL (events.video_url). field based on the type of event, so for now this issue / user story could cover the form fields on the event creation page.
allella commentedon Oct 27, 2020
The idea on the event's venue type UI element would be to only display the relevant form fields.
These are not mutually exclusive, so an event can be both physical and online.
[-]As an organizer I can create events and set their location, tags and capacity.[/-][+]As an organizer I can create events and set their location, venue type, video url, tags and capacity.[/+][-]As an organizer I can create events and set their location, venue type, video url, tags and capacity.[/-][+]As an organizer I can create events and set their venue type, venue, video url, tags and capacity.[/+]allella commentedon Nov 7, 2020
@KatieN I'm copying the authorization notes for CRUD an event here since they are relevant to this user story.
(via Discord) I don't think we have the permissions logic entirely figured out yet, but the ability for a user to post events on 1 or more chapters will depend on their authorization.
Authorization will come from either of
Lots of earlier discussion on this issue led to this summary #296 (comment) which was then closed via PR: #335
A user with the role of owner or administrator would be able to CRUD events for all chapters in the instance and we infer that from their role in user_instance_roles and any event.chapter_id values would be from a drop-down field that populated with all values from the chapters table.
An organizer would be a user with specific authorization role entries via the user_chapter_roles table. They would have 1 or more such roles previously granted by the administrator or owner. The user_instance_roles.chapter_id values would be joined to the chapters table to populate a form field (drop-down) of possible values for events.chapter_id when an organizer creates or updates an event. Or, in the case the organizer only has authorization to a single chapter, then perhaps the app logic forces the events.chapter_id to that specific chapter_id
The role tables are reflected in the schema.
The role tables aren't reflected in the out-of-date schema ER diagram, but the rest of the earlier schema is shown athttps://github.com/freeCodeCamp/chapter/blob/master/docs/data/schema.png
#296 (comment)
[-]As an organizer I can create events and set their venue type, venue, video url, tags and capacity.[/-][+]As an organizer, owner, or admin I can create events and set their venue type, venue, video url, tags and capacity.[/+]allella commentedon Nov 7, 2020
I've changed the title to include owner and admin, since they will have the same abilities.
Ryuno-Ki commentedon Nov 7, 2020
Pressing y for the schema image led me to https://github.com/freeCodeCamp/chapter/blob/4d271782e56228b567e7d0290b243cf084ffffb0/docs/data/schema.png (a permalink)
allella commentedon Nov 7, 2020
@Ryuno-Ki I'm not sure what the last comment was suggesting. Is that a good thing or a problem?
Ryuno-Ki commentedon Nov 7, 2020
Imagine, the file gets moved to another place. Or updated. The image you referenced to wouldn't be the image you had in mind (but the recent one - if at all), because you're pointing to
master. I'm pointing to the same image at the point of commit, i.e. a fixed point in time.In case you want to learn how I get there, I left the hint (pressing y on your keyboard. More shortcuts at ?), since I realised, that these are often unknown to GitHub users.
allella commentedon Nov 7, 2020
A fair point. For this issue, it was more of a side note that the schema needs work like we have open in #54. We have needed to pay attention to that issue in the docs, so I'll do better to keep it in mind on comments depending on if it matters in the context. THanks
allella commentedon Oct 19, 2021
Recent conversations lead to a more firm "line in the sand" on the use of the "role" tables and the definition of the term "role".
Also, we now expect to have user_instance_roles, user_chapter_roles, and user_event_roles, which adds to the earlier conversation in this issue about these "role" tables.
Conversely, non-role / non-authorization based fields will exist in tables like user_chapter_details, user_event_details, and perhaps even user_instance_details.
This conversation is relevant to other MVP issues, but this issue references multiple roles. So, here's a primer to get the conversation seeded for whenever we get to thinking about authorization and defining permissions for the roles.
Isolating the
user_%_rolestables from theuser_%_detailstables should keep the code less complex and less prone to accidentally allowing a user or bad actor to escalate their own roleThis is just a rough start, but here's and idea of relatively simple logic that limits access to role tables only to those roles who should need them.
allella commentedon Oct 30, 2021
@paulywill per today's chat, here's a summary of what was discussed for UI and DB changes that extend or override the #378 conversation.
regarding the Events form and fields
[-]As an organizer, owner, or admin I can create events and set their venue type, venue, video url, tags and capacity.[/-][+]Auth: As an owner or chapter admin I can create events and set their venue type, venue, video url, tags and capacity.[/+]allella commentedon May 14, 2022
I know Oliver has a good handle on the auth and roles, but there are notable earlier links in the comments on this thread, on #743 (comment) and possible more on #273
Other Earlier Conversations About Roles and Separation of Authorization vs User Details
#958
#898 (comment)
#735 (comment)
#270 (comment)
Database table dump - #967
Terminology - https://github.com/freeCodeCamp/chapter#terminology
Target ER Diagram - https://dbdiagram.io/d/617ae3f8fa17df5ea673e3ea
Database Schema - https://opensource.freecodecamp.org/chapter/ (may be out of date until PRs are committed and SchemaSpy auto-generates)
Cross-linking things so those previous conversations are easier to find.
Cross-linking things so those previous conversations are easier to find.