Textpattern Forum

You are not logged in. Register | Login | Help

#1 2006-11-12 06:24:50

jamiew
Plugin Author
From: NYC
Registered: 2005-01-08
Posts: 74
Website

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.

> Download link

  1. 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!)
  2. Patch your install: patch -p0 -i admin-list-perms-sql.patch; patch -p0 -i admin-list-perms.patch
  3. Your admin page should throw up the “update language” screen meaning the DB has been migrated. Hooray!
  4. 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

#2 2006-11-12 18:31:45

hcgtv
Member
From: Charlotte, NC
Registered: 2005-11-29
Posts: 2,154
Website

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)?


txp:tag – Textpattern Tags ~ TxPlanet – Textpattern Planet

Offline

#3 2006-11-12 18:35:57

jamiew
Plugin Author
From: NYC
Registered: 2005-01-08
Posts: 74
Website

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

#4 2006-11-12 18:47:02

hcgtv
Member
From: Charlotte, NC
Registered: 2005-11-29
Posts: 2,154
Website

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.


txp:tag – Textpattern Tags ~ TxPlanet – Textpattern Planet

Offline

#5 2006-11-12 19:42:01

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 5,010
Website

Re: Hack: only list your own articles/images/files

I’m with you bert
especially regarding the patch for images


Yiannis
——————————
neme.org | neme-imca.org | hblack.net | LABS

Offline

#6 2006-11-12 20:57:19

jakob
Moderator
From: Germany
Registered: 2005-01-20
Posts: 1,959
Website

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

#7 2006-11-13 00:24:06

jamiew
Plugin Author
From: NYC
Registered: 2005-01-08
Posts: 74
Website

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

#8 2006-11-22 10:43:33

jayrope
Plugin Author
From: Berlin
Registered: 2006-07-06
Posts: 418
Website

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)


jayrope

Offline

#9 2007-07-18 16:46:44

danwoodward
Member
From: Brooklyn NY
Registered: 2006-08-06
Posts: 51
Website

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

#10 2007-07-18 20:23:39

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,030
Website

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,

Offline

Board footer

Powered by FluxBB