Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
asv_auth_articles - limit article listing
asv_auth_articles – limit article listing
By enabling this plugin, any ‘Staff Writer’, ‘Freelancer’, or ‘Designer’ will only see a list of articles that they have written. Also, it will prevent them from viewing articles not written by them. ‘Copy Editor’, ‘Staff Editor’, and ‘Publisher’ will still be allowed to view all the articles in the list and in the edit window.
I put this together rather quickly, so I need help thinking through all the different scenarios a user might be able to get around this.
Last edited by variaas (2008-02-02 02:03:32)
Offline
Re: asv_auth_articles - limit article listing
Very useful, thanks.
Offline
Re: asv_auth_articles - limit article listing
Amit, just seen this through your other post. I’ve not tried it yet but it sounds great.
I put this together rather quickly, so I need help thinking through all the different scenarios a user might be able to get around this.
When I made the hack I had to fix a number of other situations too. Not sure if you address these:
- forward/next in the write tab should skip articles by other authors.
- the current rights setup allow authors to delete images that are not their own
- no author ownership of files
- catch manual input of another article id in the url input
TXP Builders – finely-crafted code, design and txp
Offline
Offline
#5 2009-02-27 05:24:48
- amyng
- Member
- Registered: 2007-01-05
- Posts: 55
Re: asv_auth_articles - limit article listing
Amit, is this still available?
Offline
#6 2009-03-04 22:12:57
- Plaz
- Member
- From: Minnesota
- Registered: 2004-06-02
- Posts: 33
Re: asv_auth_articles - limit article listing
Here is the one that I have:
# Name: asv_auth_articles v0.1
# Type: Admin/Client side plugin
# List articles for only the logged in user
# Author: Amit Varia
# URL: http://www.amitvaria.com
# .....................................................................
# This is a plugin for Textpattern - http://textpattern.com/
# To install: textpattern > admin > plugins
# Paste the following text into the 'Install plugin' box:
# .....................................................................
YTo5OntzOjQ6Im5hbWUiO3M6MTc6ImFzdl9hdXRoX2FydGljbGVzIjtzOjY6ImF1dGhvciI7
czoxMDoiQW1pdCBWYXJpYSI7czoxMDoiYXV0aG9yX3VyaSI7czoyNDoiaHR0cDovL3d3dy5h
bWl0dmFyaWEuY29tIjtzOjc6InZlcnNpb24iO3M6MzoiMC4xIjtzOjExOiJkZXNjcmlwdGlv
biI7cz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xsIHN0aWxsIGJlIGFsbG93ZWQgdG8gdmlldyBhbGwgdGhlIGFydGljbGVzIGluIHRo
ZSBsaXN0IGFuZCBpbiB0aGUgZWRpdCB3aW5kb3cuPC9wPgo8IS0tIC0tLSBCRUdJTiBQTFVH
SU4gQ1NTIC0tLSAtLT4KPHN0eWxlIHR5cGU9InRleHQvY3NzIj4KaDF7CiB0ZXh0LWFsaWdu
OiBjZW50ZXI7Cn0KaDJ7CiB0ZXh0LWFsaWduOiBjZW50ZXI7Cn0KPC9zdHlsZT4KPCEtLSAt
LS0gRU5EIFBMVUdJTiBDU1MgLS0tIC0tPgoiO3M6MzoibWQ1IjtzOjMyOiI5N2UwNWFhOWY0
YWQyNGNiZDQ1ZTU4MzcxODU2Zjc4MCI7fQ==
If you want something you have never had, then you must be willing to do something you have never done.
Offline
#7 2009-03-04 23:02:40
- redbot
- Plugin Author
- Registered: 2006-02-14
- Posts: 1,410
Re: asv_auth_articles - limit article listing
Amit!! Why didn’t you publish it in textpattern.org also??
I never knew about the existance of this great plugin (which I’m discovering now by chance) and I wanted this feature so badly I even added an horrible jquery attempt in my plugin bot_privs…
Anyway thanks so much, it’s very useful and works perfectly!
P.S. Thank you too Plaz for posting it here!
Offline
#8 2009-03-05 01:32:53
- amyng
- Member
- Registered: 2007-01-05
- Posts: 55
Re: asv_auth_articles - limit article listing
Thank you so much for posting this Plaz! It’s great!
Now I need to look for something that will work for the images as well…
x
Amy
Offline
#9 2009-09-08 19:01:04
- kevinpotts
- Member
- From: Ghost Coast
- Registered: 2004-12-07
- Posts: 370
Re: asv_auth_articles - limit article listing
Amit — This is a great plugin that needs more visibility. Can you add it to Textpattern.org?
Kevin
(graphicpush)
Offline
#10 2009-11-15 13:44:23
- Gerich
- Member
- Registered: 2009-08-30
- Posts: 35
Re: asv_auth_articles - limit article listing
amyng wrote:
Now I need to look for something that will work for the images as well…
Have you already find the plugin or solution for the images too?
Offline
#11 2009-11-16 22:19:55
- Gerich
- Member
- Registered: 2009-08-30
- Posts: 35
Re: asv_auth_articles - limit article listing
I have find the solution for images!
Open file /textpattern/include/txp_image.php
and before line:
$total = safe_count(‘txp_image’, “$criteria”);
insert this line of code:
global $txp_user,$privs; if (intval($privs)==5) $criteria=(($criteria==1 or $search_method==‘author’)?(‘’):($criteria.’ and ‘)).”(author like ‘$txp_user’)”; //otg
($privs)==5) – this an author privileges number for which we are apply the given restriction.
Offline
Re: asv_auth_articles - limit article listing
what about if i want to give permission to user, who can create an article in section which i give for him? and he don’t able to create an artice in other sections.
i hope you understand my question.
<txp:txp_me />
Offline