-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Open
Labels
type:featureNew feature or improvement of existing featureNew feature or improvement of existing feature
Description
New Feature / Enhancement Checklist
- I am not disclosing a vulnerability.
- I am not just asking a question.
- I have searched through existing issues.
Current Limitation
Currently, to get what Roles a user has been assigned, you would need have your own method either to run a query to get Roles the current user has.
Feature / Enhancement Description
I'm hoping that we have a getUserRoles method on the Parse.User object where we can just call the currentUser object and receive an array of Role objects the user has been assigned.
Example Use Case
let currentUserRoles = currentUser.getUserRoles()
Alternatives / Workarounds
Currently, we have to make our own method to run the query like so
Parse.Cloud.define("getUserRoles", async (request) => {
const { user } = request
return await new Parse.Query(Parse.Role).equalTo("users", user).find({useMasterKey:true})
}, {
requireAnyUserRoles: ["admin"]
})
3rd Party References
none that I can think of.
MrMartinR, mtrezza and andrewalc
Metadata
Metadata
Assignees
Labels
type:featureNew feature or improvement of existing featureNew feature or improvement of existing feature