From 0baeae746f30fb71f4e3beca9016603c95b75f7e Mon Sep 17 00:00:00 2001 From: kongtiaowang Date: Tue, 24 Jan 2023 09:00:29 -0500 Subject: [PATCH 1/3] fix wrong user --- modules/issue_tracker/jsx/IssueForm.js | 1 - modules/issue_tracker/jsx/attachments/attachmentsList.js | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/issue_tracker/jsx/IssueForm.js b/modules/issue_tracker/jsx/IssueForm.js index 82f48d9ce61..1fed63d2270 100644 --- a/modules/issue_tracker/jsx/IssueForm.js +++ b/modules/issue_tracker/jsx/IssueForm.js @@ -570,7 +570,6 @@ IssueForm.propTypes = { baseURL: PropTypes.string.isRequired, action: PropTypes.string.isRequired, issue: PropTypes.string.isRequired, - whoami: PropTypes.string.isRequired, }; export default IssueForm; diff --git a/modules/issue_tracker/jsx/attachments/attachmentsList.js b/modules/issue_tracker/jsx/attachments/attachmentsList.js index f33652b573f..cf485a17730 100644 --- a/modules/issue_tracker/jsx/attachments/attachmentsList.js +++ b/modules/issue_tracker/jsx/attachments/attachmentsList.js @@ -100,7 +100,7 @@ class AttachmentsList extends Component { */ displayAttachmentOptions(deleteData, item) { if (this.props.userHasPermission - || this.state.attachments.whoami === item.user) { + || this.state.issueData.whoami === item.user) { return (
From 1cde365bc4fe377e93bbede67e9df89cb4dd3713 Mon Sep 17 00:00:00 2001 From: zaliqarosli Date: Wed, 22 Mar 2023 16:19:12 -0400 Subject: [PATCH 2/3] fix whoami data access --- modules/issue_tracker/jsx/IssueForm.js | 1 + modules/issue_tracker/jsx/attachments/attachmentsList.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/issue_tracker/jsx/IssueForm.js b/modules/issue_tracker/jsx/IssueForm.js index 1fed63d2270..90b7a972617 100644 --- a/modules/issue_tracker/jsx/IssueForm.js +++ b/modules/issue_tracker/jsx/IssueForm.js @@ -153,6 +153,7 @@ class IssueForm extends Component { baseURL={this.props.baseURL} attachments={this.state.issueData['attachments']} userHasPermission={this.props.userHasPermission} + whoami={this.state.issueData.whoami} /> ); diff --git a/modules/issue_tracker/jsx/attachments/attachmentsList.js b/modules/issue_tracker/jsx/attachments/attachmentsList.js index cf485a17730..3b350d3d414 100644 --- a/modules/issue_tracker/jsx/attachments/attachmentsList.js +++ b/modules/issue_tracker/jsx/attachments/attachmentsList.js @@ -100,7 +100,7 @@ class AttachmentsList extends Component { */ displayAttachmentOptions(deleteData, item) { if (this.props.userHasPermission - || this.state.issueData.whoami === item.user) { + || this.props.whoami === item.user) { return (
@@ -244,6 +244,7 @@ AttachmentsList.propTypes = { issue: PropTypes.string.isRequired, baseURL: PropTypes.string.isRequired, attachments: PropTypes.array, + whoami: PropTypes.string.isRequired, }; AttachmentsList.defaultProps = { attachments: [], From 18a7da1f1f2a10fdb4af46e9899bcfd234d4cae0 Mon Sep 17 00:00:00 2001 From: zaliqarosli Date: Wed, 22 Mar 2023 17:29:32 -0400 Subject: [PATCH 3/3] fix access to get issue data --- modules/issue_tracker/php/edit.class.inc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/issue_tracker/php/edit.class.inc b/modules/issue_tracker/php/edit.class.inc index 533b6e3ab4a..448dac4997b 100644 --- a/modules/issue_tracker/php/edit.class.inc +++ b/modules/issue_tracker/php/edit.class.inc @@ -852,7 +852,8 @@ class Edit extends \NDB_Page implements ETagCalculator */ function _hasAccess(\User $user) : bool { - return $user->hasPermission('data_entry'); + return $user->hasPermission('issue_tracker_reporter') + || $user->hasPermission('issue_tracker_developer'); } /**