User login

RE: Node access module (based on users listed in userreference fields)

Searched words: 
userfield based permissions to content userreference linking

I created a module (attached, in case you're curious) that's a user reference widget. When placed on a node type, it will hide itself and fill itself in from the URL with the person the request is being made of. When a node with the field on it is submitted, it emails the person.

What I need is a way to allow the user in the user reference field the same rights to the node as the author of the node. So for all access control, they should be treated the same.

Do you think that's something you can / want to do?

Thanks,

Michelle

[requestfield.zip]

Hi Michelle,

Woohoo!

This took me much longer than expected but then everything does. You can tell your client the World Social Forum was placed in jeopardy. But I desparately needed a completable task for a change!

I've tested the part you need pretty thoroughly, it was so much fun to toggle the options back and forth once it started working.

What I haven't tested that I'd appreciate if you could: multiple value userreference fields.

The other thing you didn't request that I haven't tested is the general access to all nodes under userreference access control.

The module is attached but I'll be putting it in CVS as soon as I can get to it.

Finally, I think it would be good if it did things like automatically recognized the presence of your module and set its userreference field and edit and view privileges accordingly, or provided hooks for your module to do this.

It would be a very simple hook, come to think of it-- a wrapper around the variable_set userreference_access uses. Feel free to add it!

I would appreciate if you could audit the code. Style, optimization, comments, help text, everything.

Which brings me to my last caveat: there's some funky static caching of the node IDs each user has access to. I think I covered every contingincy where this list should be updated, but if at any point the module displays, ah, unexpected behavior, this could be it.

Best,

benjamin

Agaric Design Collective
http://AgaricDesign.com/

Resolution

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Internal paths in single or double quotes, written as "internal:node/99", for example, are replaced with the appropriate absolute URL or path. Paths to files in single or double quotes, written as "files:somefile.ext", for example, are replaced with the appropriate URL that can be used to download the file.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <blockquote> <small> <h2> <h3> <h4> <h5> <h6> <sub> <sup> <p> <br> <strike> <table> <tr> <td> <thead> <th> <tbody> <tt> <output>
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • Lines and paragraphs break automatically.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.