1
blowback
Per-topic group permissions?
  • 2003/10/5 2:05

  • blowback

  • Just popping in

  • Posts: 3

  • Since: 2003/8/24


I've got a heavily modded XOOPS 2.0.3, which I hacked about to so that everything (eg xoopsgallery) works properly without register_globals, and so that stories can live in multiple topics.

The final hack I want in place before going live is to allow any given group to be able to create/edit articles in specific topics but no in others.

While I was browing xoopstopic.php, I found a bunch of references to XoopsPerm::getPermitted() and various other methods, referencing permissions like "ReadInTopic" and "SubmitInTopic".

This stuff looks like it does what I want - however, I can find no other references to XoopsPerms, either in my sources or in the CVS tree. It looks as if XoopsPerms maintains a database similar to xoops_group_permissions, but's that about as far as I've got.

Does the missing code exist anywhere, or am I going to have to implement it?

2
blowback
Re: Per-topic group permissions?
  • 2003/10/12 17:43

  • blowback

  • Just popping in

  • Posts: 3

  • Since: 2003/8/24


No matter, I ripped it all out and implemented some stuff using the existing permissions system. ;)

3
kahumbu
Re: Per-topic group permissions?
  • 2003/10/30 15:02

  • kahumbu

  • Documentation Writer

  • Posts: 277

  • Since: 2003/8/23


Hi,

I want to implement something similar to what you wanted. Could you share how you were able to do it?

Thanks!

4
blowback
Re: Per-topic group permissions?
  • 2003/10/31 23:09

  • blowback

  • Just popping in

  • Posts: 3

  • Since: 2003/8/24


Um, kinda difficult to go into the details here, as the hacks are extensive and quite pervasive. As an indication these are the files I've modified:

./class/xoopstopic.php.ORIG
./class/xoopstree.php.ORIG
./class/smarty/plugins/resource.db.php.ORIG
./modules/news/index.php.ORIG
./modules/news/admin/index.php.ORIG
./modules/news/admin/storyform.inc.php.ORIG
./modules/news/class/class.newsstory.php.ORIG
./modules/news/include/storyform.inc.php.ORIG
./kernel/groupperm.php.ORIG
./kernel/group.php.ORIG

Basically, I've used the existing group_permissions class and added "topic_read" and "topic_post" permissions.

This has involved adding SetPermissions(), deleteByItem(), makePermittedSelBox() and makeTopicSelBox() methods to XoopsTopic, makeMyPermittedSelBox() and makeTopicMultiSelBox() methods to XoopsTree, a getNonGroupsByUser() method to XoopsMembership, makeMySelBox() and makeMyMultiSelBox() methods to XoopsGroupHandler.

Finally, I added getAllPermitted() to XoopsNewsStory, and rewrote its getAllPublished() method, and many of the other methods in there to use it.

What else...oh I moved the membership stuff out of group.php into its own file so that a handler can be properly instantiated for it.

Unfortunately, all this is tied up with another hack to allow stories to appear in multiple topics, for which I implemented a new XoopsGhost class (couldn't think of a better name!) and corresponding database table.

Sorry, it's probably not the quick and easy answer you were after. If you want, I can mail you a snapshot of my current XOOPS source tree for you to play with.

My long term plan is to diff against current sources and submit the changes, but I need to get my website off the ground first, and that's taking a while coz of the amount of XOOPS mods I'm having to do to get it to do what I want.

If you think that lot's bad, you should see what I did to xoopsgallery... ;)

bb

Login

Who's Online

354 user(s) are online (256 user(s) are browsing Support Forums)


Members: 0


Guests: 354


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits