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

fix: edit event accessible to user with event roles only #3500

Merged
merged 3 commits into from
Sep 7, 2019

Conversation

shreyanshdwivedi
Copy link
Member

Fixes #3498

Short description of what this resolves:

Currently, any user can access edit page of the event.

Changes proposed in this pull request:

  • Edit event page accessible to users with event roles only
  • Owner role not available in Manage roles section

Checklist

  • I have read the Contribution & Best practices Guide.
  • My branch is up-to-date with the Upstream development branch.
  • The acceptance, integration, unit tests and linter pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

let event = this.modelFor('events.view');
let { currentUser } = this.authManager;
if (!(currentUser.isAnAdmin || currentUser.email === event.owner.get('email') || event.organizers.includes(currentUser)
|| event.coorganizers.includes(currentUser) || event.trackOrganizers.includes(currentUser)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shreyanshdwivedi Just make sure if this hierarchy correct, I mean not every event role should have access to Edit Page. Confirm with @CosmicCoder96 or @mariobehling once, Else it is gtg.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think currently we are giving full access to all the event roles. @CosmicCoder96 is there any role which is needed to be removed?

Copy link
Contributor

@abhinavk96 abhinavk96 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All roles seem fine for now

@shreyanshdwivedi
Copy link
Member Author

@kushthedude @uds5501 @mrsaicharan1 please review

@fossasia fossasia deleted a comment Sep 7, 2019
@kushthedude kushthedude merged commit 99dd536 into fossasia:development Sep 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inviting a second "Owner" breaks ownership
5 participants