Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Hack: only list your own articles/images/files
I’ve fleshed out patches for an admin.list privilege that allows some user roles to only see their own articles, images, and files — super handy for multiuser sites. Originally developed by Jakob_R and discussed here. I submitted it for inclusion in core but never heard anything back, so I’m publishing it here. I use this on literally every one of my TXP installs and figured you guys might find it handy too.
Note: this is not a plugin. Modifications to your TXP core ensue.
- Drop the _to_4.0.5.php in /textpattern/update (to add an ‘author’ column to txp_file… this will become outdated with future versions obviously!)
- Patch your install:
patch -p0 -i admin-list-perms-sql.patch; patch -p0 -i admin-list-perms.patch
- Your admin page should throw up the “update language” screen meaning the DB has been migrated. Hooray!
- I believe the admin.list priv can be edited in the txp_privs table, or else it’s in lib/admin_config.php
Last edited by jamiew (2006-11-12 06:27:13)
Offline
Re: Hack: only list your own articles/images/files
This is awesome Jamie!!
I have a site I can use this on right away, had been waiting for something like this to implement multiblog functionality. I’ll install it locally and let you know how it goes.
I imagine this patch is against 4.0.4 and not what’s in SVN (r2078)?
We Love TXP . TXP Themes . TXP Tags . TXP Planet . TXP Make
Offline
Re: Hack: only list your own articles/images/files
Patched against rev. 1991, which is very close to what became 4.0.4. I havn’t had any probs patching any kind of “recent” installs
Offline
Re: Hack: only list your own articles/images/files
The site in question is running Textpattern version: 4.0.4 (r1956), I’ll load it up on my local test server and apply the patches.
It’s a shame that this patch never made it into the core for 4.0.4, could of been a big selling point. Just to add, I had submitted a similar request to Team Textpattern, something very simple like what your patch does but we never came to any solid decision.
We Love TXP . TXP Themes . TXP Tags . TXP Planet . TXP Make
Offline
Re: Hack: only list your own articles/images/files
I’m with you bert
especially regarding the patch for images
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: Hack: only list your own articles/images/files
thanks jamie for bringing it up to date. I’d submitted it too but…
I’m also using it for a mini multi-blog situation.
EDIT: jamie, is this the same as my original admin.list permissions patch plus the file authors or have you gone the whole hog since and added image.edit, image.edit.own, image.delete and corresponding file permissions?
Last edited by jakob (2006-11-12 22:28:02)
TXP Builders – finely-crafted code, design and txp
Offline
Re: Hack: only list your own articles/images/files
Just admin.list for now, since I didn’t have a pressing need for the others. Until there’s some interest from core about including this stuff I’m also a little hesistant to make the patches even bigger. :(
I’m putting the finishing touches on a plugin (and a small patch) to easily edit the permissions table and move the currently hard-coded stuff in admin_config.php to the DB (finally!)
There’s been lots of talk of overhauling the perms system elsewhere that hasn’t really led to much. I’m all for just introducing incremental changes like this, figuring it out as we go along. Don’t want to muck things too much, though. Please criticize, propose ideas, publish risky patches, etc!
Offline
Re: Hack: only list your own articles/images/files
oh jamie. what a great idea. i hesitate installing it now, since i only have a live site to test (4.0.4 release) – should i just… go for it?
on another notre it’ll be awesome to be able to configure new users, who’d be able to write only for specified sections (like from a section drop down menu with multiple select when configuring new user).
Last edited by jayrope (2006-11-22 10:45:36)
A hole turned upside down is a dome, when there’s also gravity.
Offline
Re: Hack: only list your own articles/images/files
Hi, I’d like to use this feature but will it work in 4.0.5?
Offline
Re: Hack: only list your own articles/images/files
Jamiew.
What a very clever hack. Works fine with 4.0.5 (manual update).
Do you think it will be possible to show only article’s comments authors?
Regard,
Patrick.
Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.
Offline
Re: Hack: only list your own articles/images/files
Could someone clue me into how I actually install the patch, specifically where I use this line of code
patch -p0 -i admin-list-perms-sql.patch; patch -p0 -i admin-list-perms.patch
Thanks in advance for any helpful hints.
Offline
Re: Hack: only list your own articles/images/files
Some advices :
Have to run this command line on Linux (perhaps on XP, not tested) and run this line on the root of the site (put the 2 sql files on the root) ; and in 2 parts (each patch separatly).
Or, look at the 2 sql files and make your change manualy : you have a flag for the position with this couple line and column :
@@ 20,7 @@
(line 20 and column 7)
Easier on a TXP 4.0.4 version ; after use the example to make the changes manualy on a TXP 4.0.5.
Patrick.
Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.
Offline