Add "returnOnlyRoleNames" option to Role.getRoles [2.x]#2993
Conversation
Currently the return type of Role.getRoles() method is inconsistent: role names are returned for smart roles and role ids are returned for static roles (configured through user-role mapping). This commit adds a new option to Role.getRoles() allowing the caller to request role names to be returned for all types of roles.
|
@bajtos : we should update the doc to reflect this option, this should land in the api doc, here. but also we could update the security section to add more details and examples on Role, ACL, AccessTokens methods ? |
|
@ebarault sure, updating docs is a good idea! Would you mind contributing those changes yourself? (EDITED) API docs are generated from the jsdoc comments in the code. The section Role.getRoles() is generated from this comment. I guess I should have asked you to include the documentation changes in this pull request 😄 The content of "security section" can be edited here: https://github.com/strongloop/loopback.io/blob/gh-pages/pages/en/lb2/Authentication-authorization-and-permissions.md |
|
@bajtos : sure, happy to help. I will propose additions in the coming days |
Currently the return type of Role.getRoles() method is inconsistent: role names are returned for smart roles and role ids are returned for static roles (configured through user-role mapping).
This commit adds a new option to Role.getRoles() allowing the caller to request role names to be returned for all types of roles.
Backport #2975
cc @ebarault