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

Set User Access API not working #9180

Closed
ahdelgado opened this issue Nov 6, 2015 · 7 comments
Closed

Set User Access API not working #9180

ahdelgado opened this issue Nov 6, 2015 · 7 comments
Assignees
Labels
worksforme The issue cannot be reproduced and things work as intended.
Milestone

Comments

@ahdelgado
Copy link

UsersManager.setUserAccess(userLogin, access, idSites) API returns false success message when API is called. Verification that user access was not set is done through UI after refreshing the Administration/Users screen. This API was working fine before the Piwik update. Can we rollback to previous Piwik version? Thanks.

@tsteur
Copy link
Member

tsteur commented Nov 8, 2015

Which Piwik version are you using now and which one did you use before? From what I see there were no changes to this method over the last months.

How do you call this API method? Via JavaScript? PHP? Do you actually get a success message as a return from the API? Can you post the response here?

@ahdelgado
Copy link
Author

Which Piwik version are you using now and which one did you use before?

I am using version 2.15.0. I don’t recall which version I was using before.

From what I see there were no changes to this method over the last months. How do you call this API method? Via JavaScript? PHP?

I use Ruby on Rails to make the call.

Do you actually get a success message as a return from the API? Can you post the response here?

Yes. I do get a success message. The message is below.

result
success message="ok"/
/result

I also tried testing the call by attempting to set user access for a user that doesn’t exist and it returns the correct error message below.

result
error message="User 'mc_user_ulhe349mx35' doesn't exist."/
/result

However, when I do another test setting user access for a website that doesn’t exist, I get a success message again instead of getting the appropriate error message.
Thank you.

@tsteur
Copy link
Member

tsteur commented Nov 9, 2015

Setting user access for non-existing websites is covered here: #8697

I had a look again at the code and it should work fine. Does it work for you when you change permissions in the UI itself?

Maybe you can let us know how you call it (the parameters that you are sending to that API method), what you expect to happen and what actually happens? This way we can maybe reproduce it.

@ahdelgado
Copy link
Author

I can change access thought the UI just fine. Only through the API is it not working.

The URL I am sending to Piwik is below. I removed the token auth info since this is a public forum but I am using a super user token auth. It returns success message but user access does not get set. Thanks.

https://analytics-review.mobilecause.com/?access=admin&idSites=707&method=UsersManager.setUserAccess&module=API&token_auth=REMOVED&userLogin=mc_user_ulhe349mx34

@tsteur
Copy link
Member

tsteur commented Nov 9, 2015

I just tried the exact same call just with a different siteId and it works just fine (created a user having the same login name). Do you have access to the database? Maybe the permission is actually set but something else is not working? You can verify in the access or piwik_access MySQL table.

Just to be sure: In the users manager, do you select the website 707 to check whether permissions were set?

@ahdelgado
Copy link
Author

oh shoot. sorry about that. That was it. I needed to select the correct website in Users manager to see the access set. Thank you!

@tsteur
Copy link
Member

tsteur commented Nov 9, 2015

No worries :)

@tsteur tsteur added the worksforme The issue cannot be reproduced and things work as intended. label Nov 9, 2015
@tsteur tsteur added this to the 2.15.1 milestone Nov 9, 2015
@tsteur tsteur self-assigned this Nov 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
worksforme The issue cannot be reproduced and things work as intended.
Projects
None yet
Development

No branches or pull requests

2 participants