The purpose of this module is to assign one user a specific node and give
permissions to edit it even though he has no global permissions for it.
There are great modules like workbench_access and other out there, but they were to complex for my needs.
Here you don't have to define anything but who can edit the node next.
There are no hierarchies, no groups, no more definitions, only a straight lined streamed workflow.
The way this works is the following:
User A has rights to edit node X.
User B has NO rights to edit node X.
User A edits node X and assigns (through the node_assignment interface at the bottom of each node) node X to node B and can add a text optionally "Please check this and assign it back to me"
User B is emailed with the message included, telling him he can edit the node.
When the User B tries to edit the node now, he has full access to edit it. He can also "reassign" it using the node_assignment form.
The sandbox is here: http://drupal.org/sandbox/reptilex/1485172
This is a Drupal 7 only module.
Comments
Comment #1
patrickd commentedwelcome,
Please read about the project application workflow
Remove LICENSE.txt, it will be added by drupal.org packaging automatically.
You are working in the "master" branch in git. You should really be working in a version specific branch. The most direct documentation on this is Moving from a master branch to a version branch. For additional resources please see the documentation about release naming conventions and creating a branch in git.
while waiting for an in-depht review of your module you can start out fixing some coding style issues detected by automated tools:
http://ventral.org/pareview/httpgitdrupalorgsandboxreptilex1485172git
You can also get a review bonus and we will come back to your application sooner.
regards
Comment #2
chertzogBefore i go in to the review, Node Access User Reference handles pretty mush the same functionality as this. The only thing i see that is different, is that you module sends an email notification. And you could easily use Rules to send an email to the referenced user, on node save. You may want to check that out.
In addition to the style and coding standards that will show up in the ventral.org PAReview, here is a manual review:
Info File:
The package should probably be "other" and your files declarations are first unnecessary, and second wrong. They should be:
Install File:
You have a field called "assignee" but the description is referring to the "assigner." You may want to change the fields "uid" and "assignee" to "assignee" and "assigner," and update the descriptions to "assignee - the user who the node has been assigned to" and "assigner - the user who assigned the node."
Module File:
On line 113:
Why not something like:
Check out db_merge().
More info here http://drupal.org/node/310085.
On line 115 you use mail(), you should probably check out drupal_mail()
Check out the Example's module example for a more detailed explanation of drupal_mail().
Also this will probably be on the PAReview, but use 2 spaces instead of tabs, and the string concatenation operator "." need spaces before and after. You have some but need more mainly on lines 115-117.
Comment #3
reptilex commentedThank you very much for the detailed review. I will check if my functionality is covered completely by the mentioned modules, if not I will correct the errors and let the module be reevaluated.
Comment #4
jpontani commentedsimple_node_assignment.info
- The files[] property is only required for files that you need to include regularly, such as class definitions or helper functions. You do not need to require the install or module file as these are done automatically a) upon install and b) every page call includes the module file
simple_node_assignment.install
- Your schema you have the nid as a serial. Serial schema types are for auto-incrementing columns, such as unique identifiers. Consider switching this to integer. You should also consider adding a key to the schema that keys on both nid and uid. As it stands currently you can only have a single user have access to edit the node from your module (unless this is by design).
simple_node_assignment.module
- You don't need to check_plain values retrieved from a database query when you are writing them using the db_* functions or _write_record function and doing the check_plain on insert
Comment #5
klausiClosing due to lack of activity. Feel free to reopen if you are still working on this application.