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

Only members of organisations should be allowed to create events for them #276

Closed
akshatgarg12 opened this issue May 25, 2021 · 6 comments · Fixed by #337
Closed

Only members of organisations should be allowed to create events for them #276

akshatgarg12 opened this issue May 25, 2021 · 6 comments · Fixed by #337
Assignees
Labels
bug Something isn't working

Comments

@akshatgarg12
Copy link
Contributor

Describe the bug
Any user can create events for any organisation

To Reproduce
Steps to reproduce the behavior:

  1. create a new organisation
  2. login with a diff account
  3. use create-event mutation without joining the org

Expected behavior

User should only be able to create events in the organisation if they are a member of it.

Actual behavior
Anyone can create events.

Additional details
The logic in the /resolvers/event_mutations/createEvent.js is to be changed to deal with this.

@github-actions github-actions bot added bug Something isn't working unapproved Unapproved for Pull Request labels May 25, 2021
@uzaxirr
Copy link
Contributor

uzaxirr commented Aug 2, 2021

Hey, I would love to work on this issue!!

My Approach:

  • I would create a boolean function inside createEvent.js which looks up in models/User.js if user is a part of or has created the organization. If yes the function returns true or else false
  • if the above function returns true only then the rest of the code inside createEvent.js would execute or else an auth error would throw-up

@palisadoes palisadoes removed the unapproved Unapproved for Pull Request label Aug 3, 2021
@palisadoes
Copy link
Contributor

@sumitra19jha Is this still an issue with the API?

@sumitra19jha
Copy link
Contributor

Yes, this issue still persist. It hasn't been updated

@palisadoes
Copy link
Contributor

@uzair-ali10 please proceed

@uzaxirr
Copy link
Contributor

uzaxirr commented Aug 4, 2021

@palisadoes
Yea Sure, On it!

@uzaxirr
Copy link
Contributor

uzaxirr commented Nov 24, 2021

@palisadoes
Please Close this issue it is resolved via #337

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants