Hey all,
I'm about to launch into yet another custom module build, and I wanted
to see if I'm missing the obvious and this thing already exists (or
has been somewhat built).
The use case is to allow access to nodes (node_access) based on their
placement within a drupal menu tree. Seems obvious, but keyword
searching through available modules didn't turn up anything that
seemed to match. I did locate the "Menu Subtree" module which seems to
provide some complimentary functionality in terms of restricting the
areas of a menu tree into which new nodes can be placed:
http://drupal.org/project/menu_stp
For access, it points to fago's menu_per_role module, but this is
about access to menu links, not node permissions. In the other
node-access modules, I didn't find one that seeks to allow/deny access
based on menu position. So that's what I'll begin working on.
Implementation seems fairly straightforward based on
hook_node_access_records() and hook_node_grants(). Assuming I'm right,
the next fun thing would be looking at integrating this with
menutrails.module so it can work for broader classes of nodes and not
just those placed directly into the menu tree.
Please let me know if I'm missing something obvious. :)
cheers
-josh
--
--------------------
Josh Koenig, Partner & CTO
http://www.chapterthree.com
Was actually thinking about this the other day. I feel its a lil silly to
have modules provide the priority for access control. I would really love to
develop a drag and drop weight interface for the priority settings.
Essentially, develop a node_access interface that assigns the priority for
all node_access modules exposed currently.
Wondering if theres any traction in that idea, and if so I can start hashing
it out.
> You no longer need to fiddle with priorities when overriding OG
> records -
> http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/og/modules/og_…
> .
>
> There is currently no hook for adjusting grants.
>
> On Tue, Mar 31, 2009 at 7:26 AM, Llu?s <enboig(a)gmail.com> wrote:
> > I am developing a module to create "sub user types" inside OG.
> > I have been able to modify hook_node_access_records using the
> > "priority" so in certain cases I override OG access system.
> >
> > Now I need to "override" the hook_node_grants so In certain cases a
> > user who should be able to see certain nodes don't see them; how can I
> > achieve this?
> >
> > Thanks
> >
> > --
> > *La vida ?s com una taronja, que esperes a exprimir-la?
> > *Si creus que l'educaci? ?s cara, prova la ignor?ncia.
> > *La vida ?s com una moneda, la pots gastar en el que vulguis per?
> > nom?s una vegada.
> > *Abans d'imprimir aquest missatge, pensa en el medi ambient.
> >
>
> --
Scott Reynolds
Cell: 630-254-2474
http://www.scottreynolds.us