CVS edit link for splash112

Busy with Drupal/Ubercart for a few years now, writing custom modules and installing sites.
Feel that I now could really contribute back. Wrote a small modules pairing a user with a Taxonomy term, so one can organize users as Taxonomy terms. A first step to Hierarchical user access to nodes.

Comments

splash112’s picture

Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new2.41 KB

Module attached

avpaderno’s picture

Status: Needs review » Needs work
Issue tags: +Module review

Hello, and thanks for applying for a CVS account. I am adding the review tags, and some volunteers will review your code, pointing out what needs to be changed.

As per http://drupal.org/cvs-application/requirements, the motivation message should be expanded to contain more details about the features of the proposed module, and it should include also a comparison with the existing solutions.

splash112’s picture

Thanks

As far as I know, there is no similar module yet.
This module maintains a simple uid, tid table linking uid's to term's in a User as Term vocabulary.
Reason for doing so is utilizing the powerful Taxonomy system in Drupal for organizing users, especially useful for companies. We can now do:

the boss
- manager 1
- manager 2
- - Employee 1
- - Employee 2
- - - Assistant 1

I want to use this for a project site and write and additional ACL module that delegates rights upwards. If assistant 1 has the right to edit a node (because of a user reference, or just as owner), employee 2 will automatically get it too, and maybe even manager 2 or the boss, while employee 1 and manager 1 don't.

avpaderno’s picture

Status: Needs work » Needs review

Thanks for the explanation.

splash112’s picture

StatusFileSize
new2.76 KB

Upgraded the proposed module, it's more refined now.

Also included 2 functions which will return either all parents from a user (uid and term info) or related (uid and term info).

Hope somebody want to have a look.

splash112’s picture

StatusFileSize
new5.19 KB

And another version.
Now included is a ACL module which is a first step to get the the true power of using the taxonomy system for users.
Userreference rights to nodes are also given to the "parents" of the user and to "related", just like in a Taxonomy.

Still; need to figure out how to mass update the ACL rights after changes are made in the Taxonomy tree. Probably have to re-save all nodes again, possibly easiest done by a Views Bulk Operation.

Hope somebody would have a look.

splash112’s picture

StatusFileSize
new5.51 KB

New version which does not get comments from coder.

nikhiljha’s picture

Hi spalash112,
I have similar requirement for one of the NGO I am working for. I was browsing through source code. and I want to know if "acl_hierarchical_perms_userreference" is not set (no user reference field) will the acl_hierarchical_perms.module work? And if we are not using nodereference field where we are are setting "acl_hierarchical_perms_userreference".
Thanks
Nikhil

splash112’s picture

Hi Nikhil,

The modules are still very much an idea, far from a perfect/stable solution. So be extremely careful on when you use it.

Basically it makes an ACL for every node and and every user. Via a vocabulary_get_parents, it assigns that ACL to the user (which is strangely an output of vocabulary_get_parents) and all it's parents. So in you case, the acl would be assigned to only the user.

It seems to work for, more or less, static vocabulary trees. If you change the tree significantly, you would probably do an update on all nodes before changes take effect in all nodes. So that part need some work still.

zeezhao’s picture

Sounds interesting. Has there been any further development on this?

Right now, I have a Taxonomy for Business Units which is hierarchical. Will be nice if both can be linked together. Do you already do somthing similar?

avpaderno’s picture

Status: Needs review » Fixed
  • The points reported in this review are not in order or importance / relevance.
  • Most of the times I report the code that present an issue. In such cases, the same error can be present in other parts of the code; the fact I don't report the same issue more than once doesn't mean the same issue is not present in different places.
  • Not all the reported points are application blockers; some of the points I report are simple suggestions to who applies for a CVS account. For a list of what is considered a blocker for the application approval, see CVS applications review, what to expect. Keep in mind the list is still under construction, and can be changed to adapt it to what has been found out during code review, or to make the list clearer to who applies for a CVS account.
  1. t() is available when hook_install(), or hook_uninstall() are invoked. See the code executed from <a href="http://api.drupal.org/api/function/php_install/6">php_install()</a> as example.
  2. Hook implementation comments should be like the following one:
    /**
     * Implements hook_menu().
     */
    

    Comments for other functions should be like the following one:

    /**
     * Returns an array of related terms of the user_as_term user ID. 
     */
    
  3.         $form['identification']['name']['#description'] = t('Please change username to change term name');
    
    

    Descriptions should be sentences ending with a period.

Status: Fixed » Closed (fixed)
Issue tags: -Module review

Automatically closed -- issue fixed for 2 weeks with no activity.

avpaderno’s picture

Component: Miscellaneous » new project application
Assigned: Unassigned » avpaderno
Issue summary: View changes
avpaderno’s picture