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

Scope authorizations within the current organization #8

Open
sauloperez opened this issue Nov 2, 2020 · 0 comments
Open

Scope authorizations within the current organization #8

sauloperez opened this issue Nov 2, 2020 · 0 comments

Comments

@sauloperez
Copy link
Collaborator

sauloperez commented Nov 2, 2020

What?

In /admin/direct_verifications/authorizations we are currently listing all authorizations regardless of the organization their user belongs to. Needless to say, this is concerning because we're leaking details from all organizations.

We should only list authorizations related to the current organization.

Proposed solution

We should change the existing data fetching

def collection
Decidim::Authorization.where(name: "direct_verifications").includes(:user)
end

to fetch only authorizations whose user belongs to the current_organization. That is, join authorizations with decidim_users where decidim_users.decidim_organization_id = current_organization.id.

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

No branches or pull requests

1 participant