<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Steven Jones wrote:<br>
<blockquote
cite="midf27865f50703291242rf25c0a4gd93f6e91eff92c6d@mail.gmail.com"
type="cite">Actually having properly looked at node_access, indeed you
can't do
<br>
what you want without changes to core.
<br>
<br>
</blockquote>
That is, in fact, what I am proposing. A hook in user_access or even
$user->roles which would allow a module to add roles, thus
permissions, to a user in a particular environment -- in my case,
within an OG group context.<br>
<blockquote
cite="midf27865f50703291242rf25c0a4gd93f6e91eff92c6d@mail.gmail.com"
type="cite">'create' operations are somewhat special and the only
thing that gets
<br>
to decide if a 'normal' user can create a node is the hook_access
<br>
defined in the node's module (that is the module that allows the
<br>
creation of that sort of node.)</blockquote>
In the case I described, that would be <b>node_access</b>. With my
modification, node_access is working properly as well. The problem is
that somewhere in this process: <b>node/add/<node
type>?gids[]=<group nid>, </b>something fails. The only clue
I have is that my debug of <b>user_access</b> reveals that the arg(0)
context is lost.<br>
<blockquote
cite="midf27865f50703291242rf25c0a4gd93f6e91eff92c6d@mail.gmail.com"
type="cite"> Taxonomy Access controls creates by
<br>
using db_rewrite_sql, but in my mind that is ugly.
<br>
<br>
</blockquote>
Fortunately, the taxonomy access I need is granted by role. So, if <b>user_access
/ node_access</b> are returning the correct roles, taxonomy works
correctly automatically. That has been my experience so far.<br>
<blockquote
cite="midf27865f50703291242rf25c0a4gd93f6e91eff92c6d@mail.gmail.com"
type="cite">If any developers are still following this thread, would
adding a
<br>
invocation of nodeapi or something similar to node_access be
<br>
permissable, as in this case at least, it would be very useful.
<br>
<br>
</blockquote>
FYI, on a totally separate project, I utilized the <span
style="font-size: 12pt; font-family: "Times New Roman";">Extensible
Node Access/Authorisation Capability
patch: <a href="http://drupal.org/node/122173">http://drupal.org/node/122173</a>
which does exactly what you ask above: invokes nodeapi for access. It
works beautifully for everything EXCEPT lisitng, which requires
node_db_rewrite_sql(). And, it does not deal with <b>user_access</b>
permissions. So, even if I got it to return the correct permissions
for a node create, I still have to deal with <b>user_access </b>and <b>$user->roles</b>
calls elsewhere. <br>
<br>
The OG module itself does 18 calls to <b>user_access</b>. What I'm
saying is that if there were a way to have user_access invoke some sort
of _access hook so that other modules could add permissions (or roles)
to the ones it already creates, this would solve my problem.<br>
<br>
EXCEPT that I still can't figure out why the create isn't working by
default now.<br>
</span><br>
</body>
</html>