Skip to content
This repository has been archived by the owner on Dec 22, 2023. It is now read-only.

Provide a way to query current user roles #111

Closed
2 tasks
rickmak opened this issue Aug 18, 2016 · 1 comment
Closed
2 tasks

Provide a way to query current user roles #111

rickmak opened this issue Aug 18, 2016 · 1 comment
Assignees

Comments

@rickmak
Copy link
Member

rickmak commented Aug 18, 2016

Unable to get currentUser's roles when I logged in as non-Admin user. Would please advise?

  • Skygear Server Date/Version: v0.14.0
  • Application Platform: skygeario.com deployment.
  • Is this a regression?
  • Attached logs, screenshots

Expected Results

Current user can query his own roles by using user:query.

Actual Results

After I logged in as an Admin user, I can:
• run getUsersByEmail on currentUser's email
• run getUsersByEmail on other users' emails
=> It suits my needs when I logged in as Admin.

But after I logged in as an non-Admin user, I cannot:
• run getUsersByEmail on currentUser's email
• run getUsersByEmail on other users' emails
The response says:
{"error":{"name":"PermissionDenied","code":102,"message":"No permission to query user"}} with 403 status code.

Proposed solution

Instead of introducing complex access control to user:query. I would suggest provide an interface me that will return the current user auth data n and user record. It can be also act as an endpoint that validate the current access token validity before making others API call. In SDK, provided respective API.

For JS, I propose:

skygear.whoami()

Also auth:login will provided the user roles as in me too.

@ben181231 ben181231 self-assigned this Aug 19, 2016
ben181231 pushed a commit to ben181231/skygear-server that referenced this issue Aug 19, 2016
ben181231 pushed a commit to ben181231/skygear-server that referenced this issue Aug 19, 2016
@ben181231
Copy link
Contributor

ben181231 commented Aug 19, 2016

Tasks

  • Add user:me endpoint and include roles in the response
  • Add roles to auth (login / signup) response
  • Add supports on iOS SDK
  • Add supports on Android SDK
  • Add supports on Javascript SDK
  • Update documentation

ben181231 pushed a commit to ben181231/skygear-server that referenced this issue Aug 22, 2016
ben181231 pushed a commit to ben181231/skygear-server that referenced this issue Aug 22, 2016
Ref. SkygearIO#111

This commit also aligns the returning data
format of `me` handler with `auth:*` handlers
ben181231 pushed a commit to ben181231/skygear-SDK-JS that referenced this issue Aug 22, 2016
ben181231 pushed a commit to ben181231/skygear-SDK-JS that referenced this issue Aug 22, 2016
ben181231 pushed a commit to ben181231/skygear-SDK-Android that referenced this issue Aug 22, 2016
ben181231 pushed a commit to ben181231/skygear-server that referenced this issue Aug 22, 2016
ben181231 pushed a commit to ben181231/skygear-server that referenced this issue Aug 22, 2016
rickmak added a commit that referenced this issue Aug 23, 2016
ben181231 pushed a commit to ben181231/skygear-SDK-iOS that referenced this issue Aug 23, 2016
ben181231 pushed a commit that referenced this issue Aug 23, 2016
ben181231 pushed a commit to ben181231/skygear-SDK-iOS that referenced this issue Aug 23, 2016
ben181231 pushed a commit to ben181231/skygear-SDK-iOS that referenced this issue Aug 23, 2016
ben181231 pushed a commit to ben181231/skygear-SDK-iOS that referenced this issue Aug 23, 2016
ben181231 pushed a commit to ben181231/skygear-SDK-iOS that referenced this issue Aug 23, 2016
ben181231 pushed a commit to ben181231/skygear-SDK-JS that referenced this issue Aug 23, 2016
ben181231 pushed a commit to ben181231/skygear-SDK-Android that referenced this issue Aug 23, 2016
ben181231 pushed a commit to ben181231/skygear-doc that referenced this issue Aug 23, 2016
rickmak added a commit to SkygearIO/skygear-SDK-JS that referenced this issue Aug 24, 2016
rickmak added a commit to SkygearIO/skygear-SDK-Android that referenced this issue Aug 24, 2016
rickmak added a commit to SkygearIO/skygear-SDK-iOS that referenced this issue Aug 24, 2016
ben181231 pushed a commit to ben181231/skygear-doc that referenced this issue Aug 25, 2016
bensonby pushed a commit to SkygearIO/skygear-doc that referenced this issue Aug 25, 2016
@royuen royuen closed this as completed Sep 6, 2016
@royuen royuen removed the In Review label Sep 6, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants