parse-server icon indicating copy to clipboard operation
parse-server copied to clipboard

feat: Pass the set of roles the user has to triggers and cloud functions

Open mstniy opened this issue 1 year ago • 11 comments
trafficstars

Pull Request

Issue

Closes: #9298

Approach

Expose a field getRoles to cloud functions and triggers if the caller is a user. The field, if it exists, is an async function that resolves to a list of strings, which is the set of roles the user has.

The exposed function uses Parse's internal cache of user roles, if it is populated. Otherwise, it queries the set of roles and populates the cache before returning them.

Tasks

  • [x] Add tests
  • [ ] Add changes to documentation (guides, repository pages, code comments)

mstniy avatar Sep 06 '24 12:09 mstniy