Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Issue tracker] - fix can't Delete attachment #8006 #8337

Merged
merged 3 commits into from
Mar 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/issue_tracker/jsx/IssueForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}
/>
);

Expand Down Expand Up @@ -570,7 +571,6 @@ IssueForm.propTypes = {
baseURL: PropTypes.string.isRequired,
action: PropTypes.string.isRequired,
issue: PropTypes.string.isRequired,
whoami: PropTypes.string.isRequired,
};

export default IssueForm;
Expand Down
3 changes: 2 additions & 1 deletion modules/issue_tracker/jsx/attachments/attachmentsList.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class AttachmentsList extends Component {
*/
displayAttachmentOptions(deleteData, item) {
if (this.props.userHasPermission
|| this.state.attachments.whoami === item.user) {
|| this.props.whoami === item.user) {
return (
<div className='row'>
<div className='col-md-12'>
Expand Down Expand Up @@ -244,6 +244,7 @@ AttachmentsList.propTypes = {
issue: PropTypes.string.isRequired,
baseURL: PropTypes.string.isRequired,
attachments: PropTypes.array,
whoami: PropTypes.string.isRequired,
};
AttachmentsList.defaultProps = {
attachments: [],
Expand Down
3 changes: 2 additions & 1 deletion modules/issue_tracker/php/edit.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

/**
Expand Down