I am interested in an additional feature which would allow users with "administer nodeaccess" privileges to set default grants on a per-content-type basis. I want grants to be able to be set by default, with no need for accessing the "grants" tab. The interface could be no more complicated than an additional check box in the per-content-type tables at admin/user/nodeaccess for "set as default".

Comments

rar’s picture

I second that - right now when a new node is created there is nothing added to the table {nodeaccess}. You have to click the Grant tab and press submit before lines are added to the table {nodeaccess}. It would be nice to have an INSERT into {nodeaccess} that happens right after the node is created which takes as a default the settings from /admin/user/nodeaccess.

Anonymous’s picture

I'm not sure I understand, are you asking for per user default settings? The settings on the nodeaccess admin page are the defaults, any new nodes created use those settings. Or are you saying that's broken and new nodes aren't getting those settings? It seems to be working fine on my sites, so I'm not sure what the problem is.

rar’s picture

Or are you saying that's broken and new nodes aren't getting those settings?

Yes that's what I'm saying. I didn't know if it was broken or if that is a feature, but the table nodeaccess does
not get an INSERT when you create a new node, only when you go to the "grant" tab and press the submit button.
In my case the node is node/add/casetracker-basic-case as I'm working with the case tracker module.

matw8’s picture

I'm seeing the same thing on all the sites I have using nodeaccess. when you first create content, the Grants tab is empty. Very annoying.

Anonymous’s picture

Works fine for me on all of my sites, if anyone would like further diagnosis you'll need to either give me shell access to the affected installation or zip up the site and database dump and send to chad@confluencewebservices.com

I can't reproduce the problem so without more info I don't know what to say...

Anonymous’s picture

Ok I had an email configuration issue, so in case somebody emailed me something, you'll need to send it again...

rar’s picture

I'd have to re-create the site from scratch to send you an example because it already contains confidential info - I think it may be faster and more enlightening for me to try to debug.

Excuse my question, but I don't see where you hook into new node creation in nodeaccess.module.
The only thing I found in regards to that were the functions grants_form_submit and admin_form_submit, neither of which are hooks into generic node creation, but tie off of when you press the submit button from just those tabs.

rar’s picture

Status: Active » Closed (duplicate)

I'm moving this to duplicate - I think its a duplicate of http://drupal.org/node/139080

Anonymous’s picture

The nodeapi hook is used to deal with new node created, function nodeaccess_nodeapi. It just grabs the defaults set in the admin pages and uses those.

sinfield’s picture

debtman7, I just built a fresh new 5.1 site with no bells and whistles except for nodeaccess. I created a test_content type which I intend to take on nodeaccess default settings. I set nodeaccess to apply view/edit/delete access privileges to new posts made in that content type for both self and a testAdmin role. I created a testUser account with privileges to nodeaccess (own posts) and to create the test content type. I created a testAdmin account with the testAdmin role, as well as privileges to view content and nodeaccess privileges. Finally, I created new test_content using the testUser account, without testUser explicitly setting grants (as the defaults set in the nodeaccess admin page should take over). The content is published, testUser can see it, user/1 can see it, but testAdmin can not. Viewing the nodeaccess grants tab shows that none of the boxes which were checked in the nodeaccess admin page are checked (but they are available to be checked). If that is the default behavior, then my feature request is for those options set in the nodeaccess admin page to be default privileges for created content. If that is not the default behavior, then I guess I will zip up my site and DB dump for you. Just let me know if I am off track here.

rar’s picture

See http://drupal.org/node/139080 for solution to this problem.

mantyla’s picture

Status: Closed (duplicate) » Closed (fixed)

Problem fixed, issue closed.