Ever wondered how to enforce permission checks based on workflow status? JIRA gives us a big set of options to restrict many of the operations (like edit, comment etc) on the issue or its subtasks depending on the issue status.
Yes, I am talking about JIRA Workflow Properties.
If you need to enforce a particular permission check at any stage in the workflow, all you need to do is to add the jira.permission.* property on the concerned workflow step. Following are the steps:
For example, if you have the Edit permission restricted to jira-administrators in the permission scheme, adding jira.permission.edit.group=jira-users wouldn't grant the permission to jira-users. But instead, if you had both those groups in the Edit permission, only jira-users will be allowed to Edit as defined in the workflow permission.
Now take this opportunity and remove some of the code in your issue operations plugin that displays operations based on status ;)