-
Notifications
You must be signed in to change notification settings - Fork 11.4k
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
[BREAK] Always remove the field services
from user data responses in REST API
#10799
Conversation
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.
Please change this to breaking, as it heavily breaks the response we've been returning for a long time now.
@@ -1,4 +1,7 @@ | |||
RocketChat.API.helperMethods.set('parseJsonQuery', function _parseJsonQuery() { | |||
const VIEW_FULL_USER_FIELDS_TO_EXCLUDE = { |
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.
Don't define this every time the call happens, move it outside.
@rodrigok @graywolf336 @MarcosSpessatto what's the status on this? we need to get it merged... has the mobile team been informed of the breaking change? |
@RocketChat/android @RocketChat/ios just in case not on radar. |
@@ -52,8 +60,12 @@ RocketChat.API.helperMethods.set('parseJsonQuery', function _parseJsonQuery() { | |||
// Verify the user has permission to query the fields they are | |||
if (typeof query === 'object') { | |||
let nonQuerableFields = Object.keys(RocketChat.API.v1.defaultFieldsToExclude); |
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.
"nonQueryable"
@geekgonecrazy @marceloschmidt @MarcosSpessatto @graywolf336 this doesn't break anything for us |
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.
please see the comments
if (!RocketChat.authz.hasPermission(this.userId, 'view-full-other-user-info') && this.request.route.includes('/v1/users.')) { | ||
nonSelectableFields = nonSelectableFields.concat(Object.keys(RocketChat.API.v1.limitedUserFieldsToExclude)); | ||
if (this.request.route.includes('/v1/users.')) { | ||
if (RocketChat.authz.hasPermission(this.userId, 'view-full-other-user-info')) { |
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.
what do you think
...
const getFields = () => Object.keys(RocketChat.authz.hasPermission(this.userId, 'view-full-other-user-info') ? RocketChat.API.v1.limitedUserFieldsToExcludeIfIsPrivilegedUser : RocketChat.API.v1.limitedUserFieldsToExclude);
nonSelectableFields = nonSelectableFields.concat(getFields());
...
Refactor the if else statement on parseJsonQuery function
Can we merge this yet? |
@ggazzo what do you think? |
services
from user data responses
services
from user data responsesservices
from user data responses in REAT API
services
from user data responses in REAT APIservices
from user data responses in REST API
No description provided.