-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Restrict room rename for Task #30886
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3965,7 +3965,7 @@ function getWorkspaceChats(policyID, accountIDs) { | |
* @returns {Boolean} | ||
*/ | ||
function shouldDisableRename(report, policy) { | ||
if (isDefaultRoom(report) || isArchivedRoom(report) || isChatThread(report) || isMoneyRequestReport(report) || isPolicyExpenseChat(report)) { | ||
if (isDefaultRoom(report) || isArchivedRoom(report) || isThread(report) || isMoneyRequestReport(report) || isPolicyExpenseChat(report)) { | ||
return true; | ||
} | ||
|
||
|
@@ -3980,6 +3980,15 @@ function shouldDisableRename(report, policy) { | |
return !_.keys(loginList).includes(policy.owner) && policy.role !== CONST.POLICY.ROLE.ADMIN; | ||
} | ||
|
||
/** | ||
* @param {Object|null} report | ||
* @param {Object|null} policy - the workspace the report is on, null if the user isn't a member of the workspace | ||
* @returns {Boolean} | ||
*/ | ||
function canEditWriteCapability(report, policy) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does the API already check for this? Or are we only checking this on the front end? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems to be determined by the front end, I can seemingly change the write-capability for a workspace room that I'm not admin of if I change the front-end to allow it. |
||
return PolicyUtils.isPolicyAdmin(policy) && !isAdminRoom(report) && !isArchivedRoom(report) && !isThread(report); | ||
} | ||
|
||
/** | ||
* Returns the onyx data needed for the task assignee chat | ||
* @param {Number} accountID | ||
|
@@ -4437,4 +4446,5 @@ export { | |
getChannelLogMemberMessage, | ||
getRoom, | ||
shouldDisableWelcomeMessage, | ||
canEditWriteCapability, | ||
}; |
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.
Why are we modifying the write capability conditions? Is this relevant to the issue?
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.
@Ollyws I included it in my proposal and it is modified to have consistency as it is not shown for normal tasks
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.
Ahh I see. Makes sense, thanks.