diff --git a/src/components/ReportActionItem/TaskView.js b/src/components/ReportActionItem/TaskView.js index 1935b9c590d8..a08f341acb1f 100644 --- a/src/components/ReportActionItem/TaskView.js +++ b/src/components/ReportActionItem/TaskView.js @@ -16,7 +16,6 @@ import * as ReportUtils from '../../libs/ReportUtils'; import * as OptionsListUtils from '../../libs/OptionsListUtils'; import * as StyleUtils from '../../styles/StyleUtils'; import * as Task from '../../libs/actions/Task'; -import * as PolicyUtils from '../../libs/PolicyUtils'; import CONST from '../../CONST'; import Checkbox from '../Checkbox'; import convertToLTR from '../../libs/convertToLTR'; @@ -48,9 +47,8 @@ function TaskView(props) { const isCompleted = ReportUtils.isCompletedTaskReport(props.report); const isOpen = ReportUtils.isOpenTaskReport(props.report); const isCanceled = ReportUtils.isCanceledTaskReport(props.report); - const policy = ReportUtils.getPolicy(props.report.policyID); - const canEdit = PolicyUtils.isPolicyAdmin(policy) || Task.isTaskAssigneeOrTaskOwner(props.report, props.currentUserPersonalDetails.accountID); - const disableState = !canEdit || !isOpen; + const canModifyTask = Task.canModifyTask(props.report, props.currentUserPersonalDetails.accountID); + const disableState = !canModifyTask || !isOpen; return ( @@ -80,7 +78,7 @@ function TaskView(props) { containerBorderRadius={8} caretSize={16} accessibilityLabel={taskTitle || props.translate('task.task')} - disabled={isCanceled || !canEdit} + disabled={isCanceled || !canModifyTask} />