After a short email conversation with Mark Fredrickson about workflow based node permissions, it seemed to be feasible to grab the workflow_access code from na_arbitrator (which was discontinued after Drupal 5.0 got most of it's functionality included). Now because I needed a workflow and role based access scheme for my thesis project anyway, I grabbed the code and updated it for Drupal 5.0. What's new:

- added an .info file
- added postgresql compatibility (but not tested it)
- removed the "hunmonk dependency hacks", which are not required now dependecies being part of Drupal core
- applied the new node access API based on the fantastic node_access_example module
- done a general clean up, less magic for form altering and so on... documented special stuff like the -1 rid used, removed many temp variables and so on
- used Drupal constants where available, done away with magic role ID numbers
- added phpdoc comments where possible

Tested the module on PHP 5.1 with MySQL 5.0 and workflow module latest DRUPAL-5 branch version (1.54.2.6). The access editing seems to work nicely, data is stored, permissions are only granted when I rule them.

I would welcome the inclusion of this module as part of the workflow module suite.

Comments

gábor hojtsy’s picture

StatusFileSize
new1.05 KB

The install file.

gábor hojtsy’s picture

StatusFileSize
new138 bytes

The info file.

moshe weitzman’s picture

thanks so much, gabor. great work. i read through the code and it looks very fine. there is some fairly unusual table prefix/suffix stuff but perhaps there is no easier way. that shouldn't block this patch in any case.

moshe weitzman’s picture

I also like the heredoc usage in .install file. i haven't seen that before.

gábor hojtsy’s picture

Moshe, yes, we are doing a table with three columns in there. That was lifted from metlinofchaos' prior act, slightly modified to get rid of the tbody borders. Maybe there is a better way, in fact a css class on the table would be desirable for themers to get some free tinkering :) Although I bet themers will not start with the rarerly seen workflow access permission table, and would very rarely if every would be interested in theming it at all.

The heredoc syntax for tables was lifted from (erm.. used for consistency with) workflow.install itself, so not something for me to deserve credit for :)

mfredrickson’s picture

Status: Needs review » Fixed

Fantastic! I made a couple of small changes and left myself 2 TODO notes for later (very minor issues).

I can't thank you enough, Gabor!

I'll be releasing workflow-1.1 shortly.

killes@www.drop.org’s picture

Status: Fixed » Closed (fixed)