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

API owner is always admin in detail view #1854

Closed
philippeluickx opened this issue Nov 1, 2016 · 11 comments
Closed

API owner is always admin in detail view #1854

philippeluickx opened this issue Nov 1, 2016 · 11 comments
Assignees
Labels

Comments

@philippeluickx
Copy link
Contributor

philippeluickx commented Nov 1, 2016

On production. When in the catalog the user is someone "not admin", in the detailview it shows "admin".

@marla-singer
Copy link
Contributor

@philippeluickx It happens when api doesn't have owner any more (user deleted account) or api was created by user, who sighed up via GitHub

@bajiat bajiat added the bug label Nov 2, 2016
@bajiat
Copy link
Contributor

bajiat commented Nov 2, 2016

@marla-singer Thanks for checking. Why is the user then displayed in the Catalog, if it is one of the cases described by you? I'll post an example from apinf.io: same API in Catalog and in API profile.

@bajiat
Copy link
Contributor

bajiat commented Nov 2, 2016

Compare the following screenshots in apinf.io: owner is shown in Catalog, but not in profile view:

catalog in production

api profile production

@bajiat bajiat added the planning label Nov 2, 2016
@jykae
Copy link
Contributor

jykae commented Nov 2, 2016

Good find, taking look

@jykae jykae self-assigned this Nov 2, 2016
@jykae
Copy link
Contributor

jykae commented Nov 2, 2016

@marla-singer I tried both cases described on latest develop, works as expected. Is this behaviour happening only in production? Checking nightly

@jykae
Copy link
Contributor

jykae commented Nov 2, 2016

Nightly has same issue, trying to reproduce there.

@marla-singer
Copy link
Contributor

@jykae Let me know if you can't reproduce it, I'll try too

@jykae
Copy link
Contributor

jykae commented Nov 2, 2016

@marla-singer On nightly, my own APIs with user (admin role) I am signed in show right both catalogue & API profile. Others work like described.

@marla-singer
Copy link
Contributor

@jykae
Second case: Sign in like GitHub user, create an api and sign out. In API profile owner will be admin. Look above in Taija's screenshot.

What did you check?

@jykae
Copy link
Contributor

jykae commented Nov 2, 2016

@marla-singer Ok, now got that locally. When I log in with that Github user the profile page shows the user right.

@jykae
Copy link
Contributor

jykae commented Nov 2, 2016

Problematic line https://github.com/apinf/platform/blob/develop/apis/collection/helpers.js#L59

On the client we publish only currentUser when user is logged in, Meteor.users can be queried only on server side for security.

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

No branches or pull requests

5 participants