Plans for Drupal 6?
Stuart Greenfield - November 3, 2007 - 01:21
| Project: | Simple Access |
| Version: | HEAD |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Description
I rely on Simple Access for my current site (Drupal 5) and there was never a formal D-5 release. Is it planned to move simple access to D-6?
I'm happy to try and help out if I can as I will need this module to keep my site live if (when!) I upgrade it next. But if it is already in hand then I'm happy to wait :-)
Thanks!

#1
I've actually made a start on this - I've not been doing much Drupal coding recently, and have upgraded my Flash node module, so I thought I'd keep going with this one - hope you don't mind!
I actually already have something that (appears to be) working! I'll keep going, then contrib back a little later for review??
#2
Umm, I need to get out more.
I've been getting my head round Drupal 6, and I had previously done some work on a customised version of simple_access to address issues with the module losing access controls when working with revisions. In part I think this was due to the way simple_access wrote directly to the node_access table, rather than passing data via the grants system (earlier post on this issue). I have never used forum_access but I wonder if this change would fix that incompatability too?
Anyhow, I took the learning from the mods I made with simple_access for Drupal 5 and have had a go at porting it for Drupal 6 (because I for one definitely want this module to keep going!)
I have made quite a lot of changes, some directly related to code changes between D-5 and D-6, some to incorporate the access control changes, but also some to the "work flow". In particular I have tried to (rightly or wrongly!) model the group management form on the user role form that is built in to Drupal. Given simple access extends the concept of roles this seems logical.
To handle the node access system the module now needs three tables rather than two - the new install file uses the new hook_schema format to define each one. Also, because a large part of simple access is to do with admin then all those functions have been separated out in to simple_access.admin.inc to keep the foot print down.
It does mean that this is a fairly major change, and I hope I've not trodden on someone's toes, but I love this module so want to see it make D-6! If nothing else it's been an interesting coding exercise and I know more about the FormAPI than I did before!
Note
Moving a site from the old simple access to the new system will need a migration script. This will need to get existing simple_access data out of {node_access} and bring it in to the new {simple_access_grants}. I'm not sure when this needs to be done - if access permissions get rebuilt during an upgrade then the migration script would need to be applied to a D-5 site before upgrade starts. Having had a bad experience with my D-4.7 to D-5 where I lost the access permissions (luckily I took a backup!) I think it might mean something is needed to be run on a D-5 site before upgrade. This needs testing/work/thought!
I've attached a file with the beta for D-6 which seems to be behaving quite nicely.
Hope this helps someone...!!
#3
Once I have it working correctly in D5, I will then port it to D6
#4
I've had a look at the new simple_access for Drupal 5 and updated the work I did on a D6 version to match in with the new database structure.
I've also brought across some of the code from the D5 module, like the new look table for assigning permissions and some of the simplified code for getting things going.
One key change is that the D6 node form doesn't like having the view/update/delete settings as objects but wants everything as an array.
Anyhow, done some testing on my local set up and it seems to be working as expected, so hope this helps and saves some time!
Note - not tried migrating a simple access set up from D5 to D6, but seeing as the database doesn't change between versions I don't see any issues there...
#5
Can you please only submit patches. It is very hard to check tarballs.
#6
In this case I'm not sure how helpful a patch would be - it's a complete update for D6, so compared to the D5 module it is quite different since a lot of the functions have to be changed to fit the D6 models. In particular, there is a new file to hold all the admin functions.
When working up the code I was finding it easiest to have two windows tiled and compare each function in turn.
Can upload as a patch if you'd prefer!
#7
Yes please I really need the patch.
#8
Hi,
I just wanted to check -- any progress? Any plans to release an updated version?
I tried to use the beta2 module and it doesn't work for me. First, I get a numer of problems related to simple_access_simple_access_groups_seq being missing (this is on Postgres). I manually created the sequence, but there are still errors when adding new groups. Still, they do get created and get unique ids.
Afterwards, I tried restricting a node to a single group, but all I managed to get was that no one could access it. Users with roles in that one group could not access the page either.
Is this because I use postgres?
#9
Can someone please post a patch or I will just have to do this myself in my time.
I will not be committing this version ported version until I have a patch so I can see what is changed so I can evaluated and make and changes that I think are necessary.
#10
I've been away with work/holiday and have another busy spell coming up, so here's a patch of simple_access for Drupal 6, as it stands so far as I got as of today.
I re-organised the code so that the sequence of functions in the main module follows those in the Drupal 5 version to try and make and make the patch read easier.
The admin functions are all in a separate admin.inc file, so the patch shows big chunks as having been deleted, but then the code re-appears in the new file.
Cheers
Stuart
#11
Ok, here's an update -- I tested beta2 again, this time with MySQL instead of PostgreSQL. Apart from a single error when I tried to add a page before I created permission groups, everything works just fine.
Is there any chance of getting support for ACLs for Forums as well?
#12
I succesfully implemented this beta 2 in Drupal 6.2. Not without problems....
Installation doesn't work well ?
What I did:
- I had to create myself table simple_access_roles
- insert records into simple_access_node (make changes to some node for have an example)
- insert record into simple_access_roles for anonymous user (I understand that each role has to be in this table - without that it doesn't work for anonymous)
- rebuild permissions by admin/content/node-settings (and wait few minutes, it seems some caching is involved)
So, few hours work, but I'm happy to have Simple Access working again!
Hope it will help someone
#13
I keep getting access denied when trying to add new group, admin should have access correct ?
#14
I'm seeing problems with a fresh install of drupal 6.2 using the patch from #10, but I'm not sure how to narrow down the error, as nothing's happening, and nothing's being written to the logfile.
PHP: 5.2.0-8+etch11
mySQL: 5.0.32
When I enable simple_access, I get this: 'The content access permissions need to be rebuilt. Please visit this page.' When I click to rebuild the content access permissions, it hangs and nothing happens. No progress bar, nothing.
My install on another site, which was an upgrade from 5.x, works properly.
What can I do to help narrow down what's causing the problem? This is a test site, so I can splice in some debug code to help track it down.
#15
I have just finished the update to v2.0 and also I ported simple access to Drupal 6
#16
Automatically closed -- issue fixed for two weeks with no activity.