You are not logged in.
Yes, thank you Stef. You’re a true TXP legend. I’ve been using TXP for 6+ years, and it’s great to see how much you’ve contributed to the community, even to this day.
Anyways, I think i will wait on installing asv_auth_articles due to the points that you mentioned. I have updated to 4.4.1 and would rather make sure everything is running proper on the new code.
I’ll keep an eye out in the future though, maybe it will make it into the main branch :)
Thanks again and cheers!
It was asked earlier in this thread, but I could not find an answer. I need to restrict authors only to add new articles to a section or category. You have any tips how to archive this?
Hi Axel,the answer you miss is here and AFAIK what sacripant wrote is still fact. I think we all hope hat there wil be a possibility in the future to restrict users to specific sections.
Last edited by moon blake (2012-04-27 19:20:15)
Axel, maybe you can compose most of what you want to achieve by a mix of some of these methods:
Wow! Didn’t knew about that stuff. Thanks Uli.
I will play around a little with this possibilities and I think I can achieve what I want.
Still one question: why has obviously no one made a plugin out of Bloke’s code snippet? Or why hasn’t Bloke himself not integrated this in smd_user? Unfortunately I myself don’t know any PHP…
moon blake wrote:
why has obviously no one made a plugin out of Bloke’s code snippet?
It’s not rocket science, just paste the code into a new plugin panel in ied_plugin_composer, name it, set some prefs (I’d say: admin side plugin, load order 5) and hit Save.
moon blake wrote:
why hasn’t Bloke himself not integrated this in smd_user?
smd_user_manager is a tool to allow you to administer users and groups. What you do with the users and groups is outside the scope of the plugin. If I was to put that functionality into the plugin then, as I outlined in that thread, someone would want to play it differently and I’d be forever tweaking / expanding the plugin to suit people’s ideas of what it means to restrict users to sections.
As Uli says, with a copy of ied_plugin_composer and those 10 lines of PHP you can copy that code to create a plugin. After that, you can control who can edit what with smd_user_manager by creating a
section.your-section-name priv and assigning rights to it.
I’ve used that code (or a variation) on sites before and it works1, but I don’t use the functionality enough to warrant making and maintaining a separate plugin because each site has different ideas about what constitutes ‘admin’. To do it properly would require a configuration interface and a shedload more code. The simplest solution for me is to copy the code and alter the rights in the first line to suit the site.
1 It probably won’t work when 4.5.0 is released because the new constraints system might block its use. The plugin will likely have to be altered to take that into account (but it might still work, I’m not sure right now)
Last edited by Bloke (2012-05-02 20:21:45)
I installed it on the latest Textpattern (Revision 3769: /development/4.x) and it works fine. No Idea how far away from the real 4.5 this is, I hope it will be compatible.
As this User restriction to certain sections is necessary for the site I’m working on, and the ability to upgrade without the troubles as in drupal/wordpress etc. is one of the “sales features” the client needs!
The time frame for this project is tied to the release of Textpattern 4.5 I hope I’m not wasting time right now.
Hey Stef – how’s things?
Just trying to figure out if I am trying to use this correctly.
I’ve just taken over a site which has setup a a system where users are added via this plugin and assigned users privs, then the same user privs are entered into an article custom_field – the idea being that only users with the same user privs as the article will see the article, otherwise a message.
I’ve tested printing out the custom_field on the same form I am using this code and it works, but every time when I login with the user with the same privs, I get the error message:
<txp:smd_um_has_privs group='<txp:custom_field name="privs" />'>
<p>Sorry, you do not have the correct access privileges to view these photographs</p>
Ps – this is a tag trace:
<txp:smd_um_has_privs group='<txp:custom_field name="privs" />'> [attribute 'group'] <txp:custom_field name="privs" /> [/attribute] [<txp:smd_um_has_privs group='<txp:custom_field name="privs" />'>: false] <txp:site_url /> </txp:smd_um_has_privs>