Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2023-03-14 23:08:50
- lindabb
- Member
- Registered: 2023-02-17
- Posts: 132
restrict author
Hello,
Is there a way to restrict author to view and change by owned articles only.
Now, any author can change, delete any article , what I need to do allow only the owner to change, or delete their articles.
also restrict or hide or disable sort and display div
Thank you
Offline
Re: restrict author
lindabb wrote #335072:
Hello,
Is there a way to restrict author to view and change by owned articles only.
Now, any author can change, delete any article , what I need to do allow only the owner to change, or delete their articles.
also restrict or hide or disable sort and display divThank you
Bot_Privs might meet your requirements
…. texted postive
Offline
Re: restrict author
Have you checked this article on “User roles and privileges” in the documentation?
You certainly can restrict authors to a limited set of actions.
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
Offline
#4 2023-03-15 14:01:24
- lindabb
- Member
- Registered: 2023-02-17
- Posts: 132
Re: restrict author
Thank you all
Offline
Re: restrict author
smd_user_manager might help as you can create new roles and customise the privileges accordingly.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
#6 2023-03-15 16:54:02
- lindabb
- Member
- Registered: 2023-02-17
- Posts: 132
Re: restrict author
Thank you Bloke,
smd_user_manager worked, (Bot_Privs got mysql error). I wish the plugin had , show only owned articles, files, images so on,
no need to show other articles if no access, in this case , other authors can have private articles or files .
just an idea.
Thank you
Offline
Re: restrict author
lindabb wrote #335087:
(Bot_Privs got mysql error).
Note works for me in this envirnoment
PHP version: 7.4.30 MySQL: 5.5.5-10.3.38-MariaDB (MariaDB Server)
edit to add :
User can edit articles User can edit only published articles User can edit only his articles User can edit only his published articles User can publish new articles User can delete only his articles
Last edited by bici (2023-03-15 17:19:25)
…. texted postive
Offline
#8 2023-03-15 17:35:40
- lindabb
- Member
- Registered: 2023-02-17
- Posts: 132
Re: restrict author
Thank you bici ,
I’m using dev 4.8.9 version with php 8.1 , that plugin didn’t work, but Bloke’s suggestion worked for me,
I looked at Bot_Privs , looks minor change or comment out mysql version will work, but I didn’t want to change it.
Thanks again
Offline
Re: restrict author
lindabb wrote #335087:
I wish the plugin had , show only owned articles, files, images so on,
That’s not a priv we have available, but it’s trivial to write a plugin to do it :)
(see the 2nd example plugin in that post)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
#10 2023-03-15 20:43:15
- lindabb
- Member
- Registered: 2023-02-17
- Posts: 132
Re: restrict author
Thanks Stef ,
I have installed the plugin, and enabled it, do I need anything else to make it work ?
Now when I login as restricted user, still I see others’ articles
Thank you for your help
Offline
Re: restrict author
Hmmm it should just work out of the box. All it does is add the relevant clause to the query. Let me test it and get back to you.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
Re: restrict author
Ah wait, you need to ensure it’s of Plugin Type 3 (admin). Otherwise it won’t run.
Try this compiled plugin instead:
# mrd_for_your_eyes_only v0.1.0
# Users can only view their own content
# Stef Dawson / Dale Chapman
# https://stefdawson.com/
# ......................................................................
# This is a plugin for Textpattern - http://textpattern.com/
# To install: textpattern > admin > plugins
# Paste the following text into the 'Install plugin' box:
# ......................................................................
H4sIAAAAAAAAE+VUwWrjMBC95ysGE3ACJYmdJm1ccijby8LShS09m7E1jkVlyUhysqb033dk
u720/YLVQdaMZt48vZGMWZJmry67ziKNDUV3LkvTLGqsyCtj8950NqeeXG606sPuTRadyTpp
dLB2WbRZJatNWO+zCDtfGzuAsPXkqYIHvDijYc0LRfCjxrbBITXZvMfnnZVDzjaLau9bl63X
jnPFkLoqTbMeEpIsEuRKK1s/ld8ym2fHdKBEDYEinCVdwNckLZiLhtJoT9pPXI0VNNBjqF34
8rF939Lk2k5hlcKTm3ybKawm1Q4kr4ORrOBriWaz37okII2FInEF3cCuwX5k54g+k1vBo/EE
DASuNp0SnO46+x7ZWnmWik4Eis6kAJUlFD1Yct7K0jsgIb3UJzDVZ3CopHX+Cgzv2It0AVU6
sJ2QDW+j7TlCebLAXkInmWXRt+gcCRYTAyI8//m1mnQojaBReu6WpZPkTtm8RKUKLF8W8dey
xFcQo2ikzrl9nCAxXt7NZlWny9DLb8RczOnM1OfOtzyHzCW8zoDHSZkCFcz93zYPEt8N3nlY
whGEeVLo6sXHdqgVAmQFi4AGx+MRYsXc8zDF77BhWPKd1RDB/eMD3A8X9OcDg8YDehyNpd6A
FGsZAPlQaC32i5HnuGZw/TKC89FZYfowZIOnyVouv608Po3PdWdvQf3b8ULmFi///aXke9iI
4TVv+c+122GRFof9TVrSIaV0t09wuy/Tsri9PRwSjnv7B+cEeIb0BAAA
As noted in that thread I linked to, it might be a good idea if Publishers were exempt from the restriction so they can see all content. That would require a couple more lines of code.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline