Until issue #782858: Allowing viewing/adding to "not published" invoices is implemented (version 2) I'm looking at a way of stopping viewing/editing of a storm node.
I was looking at using the workflow module.
I've created the following:
Workflow called "Record Lock" with states "Unlocked" and "Locked". Attached to timetracking records. When the person creates it, it's unlocked and the author can still edit it. After billing, it's set to "Locked" so that the author cannot edit it (even if they have the Storm permission for it).
Workflow called "Invoice View" with states "Hidden" and "Viewable". Attached to invoice records. When an invoice is created it's hidden from the customer until it's built completely (maybe added to every day until end of month instead of doing 100's of "add to invoice" at the end of the month). When it's ready for the customer to see, it's changed to "Viewable".
The problem is that the customer can view it when it's created (as they have "view own organisation" permission).
Basically the workflow permissions are not taken into account when allowing view/edit permissions on the node.
Comments
Comment #1
juliangb commentedThis is related to Drupal core rather than Storm or Workflow particularly - if any module returns allow for a node, this allow overrides any deny rule set by another module.
I think the Storm access function would need to be edited to allow the functionality you want - it can't coordinate with another node access module.
Comment #2
juliangb commentedAs #1. This is due to the nature of the core access system.