I am confused as to why the 'create' operation has been left out.

The operations provided should be: 'view', 'create', 'update', and 'delete'

Having 'create' operations allows me to extend the content_access module such that I can provide 'create' permission handling for content types via the acl module.

This patch alters the API of the function: acl_node_add_acl()

Comments

nick_vh’s picture

  */
-function acl_node_add_acl($nid, $acl_id, $view, $update, $delete, $priority = 0) {
+function acl_node_add_acl($nid, $acl_id, $view, $create, $update, $delete, $priority = 0) {

Here I see some problems with the sites of the people that currently already are using the ACL module. Without making it clear how and why we are modifying one of the main functions.

Although I do agree that the create option is a necessary add-on.

thekevinday’s picture

Perhaps it should be written in a more backwards compatible way.

How would this be?

<?php
  */
-function acl_node_add_acl($nid, $acl_id, $view, $update, $delete, $priority = 0) {
+function acl_node_add_acl($nid, $acl_id, $view, $update, $delete, $priority = 0, $create = 0) {
</?>

Although backwards compatible, structuring the function in this way seems more awkward.

Unless I am misunderstanding how this function works, this is where the node-specific permissions seem to be saved to the database.

nick_vh’s picture

Hmm, no I would do it the logical way (so CRUD -> create, read, update, delete)

Maybe it needs a newer version tag then with a clear message that this API has changed? Salvis any ideas?

salvis’s picture

I'm not sure what the purpose of this is...

ACL works on nodes (NIDs actually). This means we need to have a node first, and then we can apply any of RUD on that node. Without a node, which is the situation where Create would apply, ACL cannot work.

There's no point in returning 'grant_create' from hook_node_access_records.

thekevinday’s picture

Does this means adding the 'grant_create' is only an issue for the content_access ACL sub-module and not the ACL core module?

Edit: I have an example use case here: http://drupal.org/node/789754

salvis’s picture

What is "the content_access ACL sub-module"?

I see your use case, but at this point I don't see what ACL could contribute to this. I think it's a CA-only issue. Please re-read #4.

thekevinday’s picture

Status: Needs review » Closed (won't fix)

So then I have misunderstood the usage of that function call and therefore the patch in ACL is not needed.

I am going to close this as won't fix.