| Re: Per-topic group permissions? |
| by blowback on 2003/10/31 23:09:22 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 |
| Re: Per-topic group permissions? |
| by kahumbu on 2003/10/30 15:02:49 Hi, I want to implement something similar to what you wanted. Could you share how you were able to do it? Thanks! |
| Re: Per-topic group permissions? |
| by blowback on 2003/10/12 17:43:09 No matter, I ripped it all out and implemented some stuff using the existing permissions system. ;) |
| Per-topic group permissions? |
| by blowback on 2003/10/5 2:05:12 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? |