This is a very clever module, thanks very much. I got to thinking (always a dangerous thing), and realized that if I had a bunch of nodes with hidden bits in them, and I suddenly decided I wanted all users of a particular role to see those bits, I would have to re-edit each node. It would be nice to have an override in the access control settings, so that for e.g. 'admin' users are allowed to see the 'hidden bits', as well as whatever user/role has been set in the actual node.

Comments

davemybes’s picture

StatusFileSize
new2.16 KB

Turns out it was much easier than I thought...this seems to work on Drupal 5.1. Patch rolled against 5.x-dev version.

Christefano-oldaccount’s picture

Status: Active » Needs review

This is interesting. Is anyone using this?

dnewkerk’s picture

Title: Add access control setting override » Add access control setting - new patch added (D5 and D6)
StatusFileSize
new5.17 KB
new1.9 KB

Here is a new patch against the current dev version, works as of July 4, 2008. I've also run the module through Coder module and cleaned everything up to Drupal coding standards.
To clarify the purpose of this patch: it adds an actual Drupal permissions option to Roles, so you can specify that a given role can always see hidden content (without having to write it within every hidden tag) and also as such solves the issue of the admin no longer seeing hidden content if other roles are specified.

Please test the patch and commit when ready. This may need security review. Thanks!

Drupal 6 version also:
I have also made an alternate patch based on this to apply "after" my Drupal 6 port patch, in case anyone would like to use this feature on Drupal 6. You must first apply the Drupal 6 port patch against the current 5.x dev, and then the D6 version of this patch second.

Please make sure you use the correct patch for your version of Drupal

- David

Apfel007’s picture

Hi David,
I have several problems to patch the module..( newbie - sorry :-))! Can you explain me again what i have to do?
Do I need to patch with your 2 Versions (hidden_content-d6port, hidden_content_access_6port) after an other? Or is one enought? An what about the directory in your other post? Where is it?
I use cygdrive und write this:
>> patch < hidden_content....module

Is this right?

Cheers Kai

dnewkerk’s picture

Hello Kai -

If you are using Drupal 5:
The Drupal 5 version upgrades the Drupal 5 version of the module with the new features and cleaned up code, for testing. Once you apply this patch you cannot currently upgrade the patched copy to Drupal 6 (must use an original version for that).

  • Download the 5.x-1.x-dev version of Hidden Content module
  • Place in your modules directory (e.g. sites/all/modules/hidden_content)
  • Download the hidden_content_access_5dev.patch file (ignore the other one)
  • Put hidden_content_access_5dev.patch into the hidden_content module directory
  • Run the command to patch the files: patch < hidden_content_access_5dev.patch

If you are using Drupal 6:
The Drupal 6 version of this patch for adding the new features only adds the features after Drupal is already patched with the port to 6 - the module has to be upgraded first to Drupal 6 first using the D6 port patch. Please do not apply this patch and then try to patch to upgrade to Drupal 6 afterward - it will not work.

  • Download the 5.x-1.x-dev version of Hidden Content module
  • Place in your modules directory (e.g. sites/all/modules/hidden_content)
  • You must now first patch this to upgrade the module to version 6, using this other patch
  • Rename the "po" subdirectory to "translations"
  • After the module works in Drupal 6 successfully, download the hidden_content_access_6port.patch file (ignore the other one)
  • Put hidden_content_access_6port.patch into the hidden_content module directory
  • Run the command to patch the files: patch < hidden_content_access_6port.patch
Apfel007’s picture

Thanx David it works!!

dnewkerk’s picture

Great to hear! I'm currently waiting for response from the module maintainer regarding my request to become a co-maintainer. If I don't hear back within 2 weeks (starting 2 or so days ago) I'll be able to send the request to the drupal.org webmasters and be given access - so within 2-3 weeks the module should be officially upgraded for both Drupal 5 and 6, or perhaps sooner if the current maintainer returns before then.

If anyone else could please test these patches to confirm further that would be great... and if anyone can assess any security implications (since this has to do with access control) then I'd love any feedback on that.

- David