-
Notifications
You must be signed in to change notification settings - Fork 10.9k
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
[NEW] API to fetch permissions & user roles #9519
Conversation
Docs created: https://github.com/RocketChat/docs/pull/527. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work.
RocketChat.API.v1.addRoute('permissions', { authRequired: true }, { | ||
get() { | ||
let result; | ||
Meteor.runAsUser(this.userId, () => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MarcosSpessatto could you change this to
const result = Meteor.runAsUser(this.userId, () => Meteor.call('permissions/get'));
Meteor.runAsUser
returns the result of the passed function.
let result; | ||
let currentUserRoles = {}; | ||
|
||
Meteor.runAsUser(this.userId, () => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
Is this PR still missing something @rodrigok & @MarcosSpessatto? |
@RocketChat/core
Closes #9518
Progress