Skip to content

[NEW] API to fetch permissions & user roles#9519

Merged
rodrigok merged 6 commits intodevelopfrom
feature/rest_api_permissions.9518
Feb 15, 2018
Merged

[NEW] API to fetch permissions & user roles#9519
rodrigok merged 6 commits intodevelopfrom
feature/rest_api_permissions.9518

Conversation

@rafaelks
Copy link
Contributor

@rafaelks rafaelks commented Jan 26, 2018

@RocketChat/core

Closes #9518

Progress

  • API: permissions
  • API: user.roles
  • Tests
  • Docs

@rafaelks
Copy link
Contributor Author

@engelgabriel engelgabriel temporarily deployed to rocket-chat-pr-9519 January 26, 2018 15:39 Inactive
@RocketChat RocketChat deleted a comment Jan 26, 2018
@RocketChat RocketChat deleted a comment Jan 26, 2018
@rodrigok rodrigok added this to the 0.62.0 milestone Jan 26, 2018
Copy link
Contributor

@MarcosSpessatto MarcosSpessatto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work.

Added tests for thiis endpoints
@engelgabriel engelgabriel temporarily deployed to rocket-chat-pr-9519 February 6, 2018 11:35 Inactive
@MarcosSpessatto MarcosSpessatto changed the title [WIP][NEW] API to fetch permissions & user roles [NEW] API to fetch permissions & user roles Feb 6, 2018
@engelgabriel engelgabriel temporarily deployed to rocket-chat-pr-9519 February 6, 2018 11:44 Inactive
@RocketChat RocketChat deleted a comment Feb 6, 2018
RocketChat.API.v1.addRoute('permissions', { authRequired: true }, {
get() {
let result;
Meteor.runAsUser(this.userId, () =>
Copy link
Member

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, () =>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

small fixes
@rafaelks
Copy link
Contributor Author

Is this PR still missing something @rodrigok & @MarcosSpessatto?

@rodrigok rodrigok merged commit 9b7eb38 into develop Feb 15, 2018
@rodrigok rodrigok deleted the feature/rest_api_permissions.9518 branch February 15, 2018 19:53
@rodrigok rodrigok mentioned this pull request Feb 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Comments