Whenever I disable ACL, any new content, whether it be forum, blog, or story posts, are unviewable unless the user is logged in.

Comments

drupnuts’s picture

I think I should elaborate and say that the content is just invisible. There are no 'access denied' errors, it just looks like the content doesn't exist at all.

Ainur’s picture

I’ve made a test on my Drupal installation:
Installed both ACL and Forum Access modules, configured one form as follows:
Create/Read/Edit/Delete: authenticated only, none for anonymous and posted some topics.
Then disabled both of the modules, and created another topic in that forum.
The result was that I can’t access it as anonymous user I get Access Denied message, but I do can access’em as authenticated user.
Cache is disabled.

Ainur’s picture

Forgot to mention that I get same behaviour with any other content type.

salvis’s picture

After disabling ACL you should go to admin/content/node-settings and click on the [Rebuild permissions] button.

fago’s picture

Version: 5.x-1.4 » 5.x-1.x-dev
Category: support » bug
Priority: Critical » Normal

hm, in content_access I've implemented a solution for that. Perhaps we should add to acl too:

in short:

/*
 * Implementation of hook_disable()
 */
function content_access_disable() {
  content_access_disabling(TRUE);
  node_access_rebuild();
}

/*
 * Remembers if we have disabled access
 */
function content_access_disabling($set = NULL) {
  static $disabling = FALSE;

  if (isset($set)) {
    $disabling = $set;
  }
  return $disabling;

/*
 * Implementation of hook_node_access_records()
 * @param $optimize If the grants should be returned optimized
 */
function content_access_node_access_records($node, $optimize = TRUE) {
  if (content_access_disabling()) {
    return;
  }
  ..
salvis’s picture

I don't think calling node_access_rebuild() is a good idea, because it can take a very long time, and even fail with a timeout.

I've already written a disable hook that displays a message, asking the user to rebuild permissions, I just haven't had the time to commit it yet.

Why do you hook node_access_records?

salvis’s picture

Status: Active » Fixed
fago’s picture

http://api.drupal.org/api/function/node_configure_rebuild_confirm_submit/5

If you look at the code it does exactly the same.. Yes, it can timeout, this is a known and not fixed d5 bug.. :/ As I know this is only fixed in d6 by using the batching api.

salvis’s picture

Yes, I know. But doing it automatically as part of disabling the module is sort of like a tipping truck that dumps its load whenever you turn off the engine. It's an unexpected side effect, and I don't think CA should do that.

The user may not necessarily want to rebuild permissions. And he's certainly not expecting that disabling a module could take a minute or two. That's why the [Rebuild permissions] button displays information and asks for confirmation before proceeding.

salvis’s picture

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

salvis’s picture

Status: Closed (fixed) » Fixed

@fago: see http://drupal.org/node/215974#comment-712837 for why we shouldn't force a permissions rebuild.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.