Download & Extend

"Organic groups access control" causes "Access denied" on content access permissions rebuild

Project:Organic groups
Version:6.x-2.0
Component:og.module
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed (cannot reproduce)

Issue Summary

I started with a freshly installed Drupal 6.14 installation with no content and no modules enabled other than default for a new install. The first thing I did with the new installation is enable "Organic groups." Next I enabled "Organic groups access control." This enablement caused this message to appear at the top of the administer modules page:

The content access permissions need to be rebuilt. Please visit this page.

I initially ignored this message and set up Organic Groups content types and permissions. Then clicked on the link of this message to rebuild content access permissions. I got a page with this message:
Are you sure you want to rebuild the permissions on site content?
This action rebuilds all permissions on site content, and may be a lengthy process. This action cannot be undone.

I went ahead with the rebuild and got a page with this message:
Access denied
You are not authorized to access this page.

Because I did this as user 1 on a fresh install I do not understand how I could be denied access to anything.

I had a look at the node_access table and found it empty. The single row that was there after installation and just before this rebuild was empty.

I am still able to access administrative functions without having to log in again. But the "The content access permissions need to be rebuilt. Please visit this page." is still there on many admin pages.

The single row in the node_access table reappears when I disable ""Organic groups access control," and the message "Content permissions have been rebuilt." appears at the top of the modules right after this disablement.

What has gone wrong here?

Comments

#1

I don't have a solution ... but I can confirm the same issue on my system. Brand new install (6.14, OG2.0) ... cannot create groups, access denied.

Any solutions out there ? It seems like a bug to me, not a support request.

#2

Category:support request» bug report

I agree this is most likely a bug. I am changing this thread category to a bug report.

#3

I also figured out that enabling organic access control needs to rebuild the content access permission. Tried out 80 times but I was unable to rebuild. Finally I have disabled that.. any solutions out here

#4

subscribing

#5

I found a couple of approaches in different posts. Neither one of them did it for me though. A lot of speculation going on.

http://drupal.org/node/300079
http://drupal.org/node/281326

#6

subscribing

#7

Subscribing

#8

Well, I checked the settings file to check if the paths etc. were set good and I also tried cookies, browser, theme change, taking the inserts from a backed up file. Nothing shows up in the systems error report and I did manage to narrow it down to the OG module and specifically to the Organic groups access control. One thing Drupal does give me when trying to run the rebuild is a 404 error.

#9

Tried a clean install, same problem.

#10

If you can give the exact sequence of steps that caused the problem that will help folks figure out what's wrong. For example, start with:

1. Install Drupal 6.14
2. Put OG 6.x-2.0 in sites/all/modules
3. Enable Organic Groups and OG Access Control
4. etc...

If you can give a full list of reproducible steps (and then reproduce them yourself) you'll make the maintainers' jobs easier (and probably figure out what went wrong along the way).

#11

1. Install Drupal 6.14,
2. Installed OG latest stable version in sites/all/modules/
3. Enabled Groups and OG Access Control
4. Got notification to rebuild,
5. Tried to Rebuild and it went bananas.

Tried on two installs now same problem. Could it be mod_sec?

#12

By "went bananas" do you mean 404? If there were other messages it would be useful for you to post them here.

#13

Yes 404 and now a 406 after I changed the permissions of the index file and turned off clean urls. I removed og but it persists.

#14

I fixed it.
1. Disable clean urls,
2. Add exception for htaccess mod_sec: SecFilterEngine Off
3. Run rebuild and it worked.

#15

I'd like to add to the chorus on this.

Using OG 6.x-2.0, drupal 6.15, and MAMP 1.8.3.

Here's how to reproduce it:

1) Install drupal 6.15
2) Make a new database
3) Configure drupal to use new database
4) Start drupal. Create admin user.
5) Add og module to drupal/sites/default/modules/
6) Enable Organic Groups module in drupal (but only Organic Groups, not the other OG modules)
7) Poke around the settings, make sure it works.
8) Enable Organic Groups access control module.
9) Click 'Save configuration.'
10) Notice that the top of the new page says: "The content access permissions need to be rebuilt. Please visit this page."
11) Visit that page. Click on 'Rebuild permissions.'
12) Result: "Access denied You are not authorized to access this page."
13) Disable Organic Groups access control module. Click on 'Save configuration.'
14) Note that the new page tells you this: "Content permissions have been rebuilt."

This is very frustrating because I'd really like to use OG and Case Tracker modules to manage projects.

I tried the suggestion in comment 14... no joy.

#16

subscribing

#17

@15: Works OK for me...

On a dev site on which I have OG access enabled I first disabled OG access (this causes a content permissions rebuilt and is the cause of your 14) ... all that happens in this case is that the {node_access} table is cleared and the default node grant is written so that all content is accessible.

I then re-enabled OG access and received the message per your 10).
11) OK
12) Get redirected to URL http://www.example.com/batch?op=start&id=14
the theme switches from the site admin theme to the default theme
and the heading is "Rebuilding content access permissions"
.. progressbar ..
then redirected to Post settings page at admin/content/node-settings (the theme switches back)

I've tried this as an admin user and also as user 1 (and made sure user 1 was in no additional admin roles) and couldn't get it to go wrong.

The batch page is generated by http://api.drupal.org/api/function/system_batch_page/6 so if you are getting an access denied message then it looks as though http://api.drupal.org/api/function/_batch_page/6 didn't return any output.

Soooooooooooo... it looks as though this is a glitch in the rebuild permissions process when there isn't any content... But probably everything will be fine when you start adding content. The bug looks to be in core rather than OG. Might be worth searching the core issue queue for an info on this.

#18

Category:bug report» support request

Doesn't seem to be a bug in OG, so making it a support request.

#19

i upgraded from a version of og I was using a year ago just recently I enabled access control and got "The content access permissions need to be rebuilt. Please visit this page." Went to rebuild the access and then the progress bar hangs at last step. I disable og access control and everything works normal after wards. Re-enable og access control and get the same error. Also this seems to cause all of my views to bug out. None of my views were able to be viewed by anonymous users.

#20

nm i figured out it was a bug related to a different module

#21

subscribing...

#22

subscribing

#23

Just to add: still having the same exact problem OG access control 6x-2.1 at the end of Sept 2010.

#24

That is not a module security exception, it effectively turns of mod security. I've had the persistent problem, on one site, where I cannot rebuild permissions; even when I turn off OG Access Control. It either says, "You are not authorized to access this page." over and over like an infinite loop or it gives me a violation error. I would definitely not use this mod security "exception", it would be very insecure.

#25

Status:active» closed (cannot reproduce)

I still don't know/ think if this is an OG specific problem

> I had a look at the node_access table and found it empty. The single row that was there after installation and just before this rebuild was empty.

You should then add the default row. The output should look like this:

mysql> SELECT * FROM node_access;
+-----+-----+-------+------------+--------------+--------------+
| nid | gid | realm | grant_view | grant_update | grant_delete |
+-----+-----+-------+------------+--------------+--------------+
|   0 |   0 | all   |          1 |            0 |            0 |
+-----+-----+-------+------------+--------------+--------------+
nobody click here