diff --git a/app/views/users/project_packages/index.json.jbuilder b/app/views/users/project_packages/index.json.jbuilder index a2574d558..ad56be7d2 100644 --- a/app/views/users/project_packages/index.json.jbuilder +++ b/app/views/users/project_packages/index.json.jbuilder @@ -16,5 +16,11 @@ json.project_packages do json.deadline_at package.display_deadline_at json.published_at package.display_published_at + + json.operation do + can_manage = current_user&.id == observed_user.id || current_user&.admin_or_business? + json.can_edit can_manage && package.editable? + json.can_delete can_manage && package.deletable? + end end end \ No newline at end of file