Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Change Role on the fly when logged in for testing
I’m logged in as the Publisher typically. Rather then create an account for each other Role for testing I was hoping there was a plugin out there that would give me a toggle present under any role. I ask here because I remember seeing something along these lines one time in the past. Perhaps this would be a plugin request if one does not exist.
txtstrap (Textpattern + Twitter Bootstrap + etc…)
Offline
Re: Change Role on the fly when logged in for testing
Hi Josh, is bot_privs the plugin you encountered before? I haven’t used it, so I don’t know if it does what you want…
*edit: I guess it allows you to change what a privilege level can do. *
Last edited by JanDW (2010-04-06 23:17:09)
TXPDream – A Textpattern Tag Library for Adobe Dreamweaver. (updated for 4.2.0) | jdw_if_ajax – Only serve certain parts of a page when requested with AJAX
Offline
Re: Change Role on the fly when logged in for testing
Also you can find the user roles and permissions in textbook.
TXPDream – A Textpattern Tag Library for Adobe Dreamweaver. (updated for 4.2.0) | jdw_if_ajax – Only serve certain parts of a page when requested with AJAX
Offline
Re: Change Role on the fly when logged in for testing
*edit: I guess it allows you to change what a privilege level can do. *
Yes. To reiterate, I’m envisioning a dropdown menu available to me as Publisher which allows me to switch roles as needed to see what they see before switching back to my Publisher status. It would be a little disguise I would put on to go where the lowly users go.
The results bot_privs gives me, for instance, is something I’d be checking in on by toggling my role.
Last edited by whaleen (2010-04-06 23:24:13)
txtstrap (Textpattern + Twitter Bootstrap + etc…)
Offline
#5 2010-04-07 00:35:03
- redbot
- Plugin Author
- Registered: 2006-02-14
- Posts: 1,410
Re: Change Role on the fly when logged in for testing
JanDW wrote:
Hi Josh, is bot_privs the plugin you encountered before? I haven’t used it, so I don’t know if it does what you want…
Hmm… unfortunately I don’t think this is the plugin you are looking for.
It allows to define what a user level privilege (such as “designer”, “staff writer”, etc.) can do and can not do without hacking admin_config.php.
If I understood correctly you are looking for a way to change user level “on-the-fly”, without logging in and out.
In this case you don’t need a plugin and you don’t necessarily need to create as many users as the roles are.
Usually I create a temporary user (i.e. “test”) other than the main user (which has publisher privileges of course) then I log in with the two different users in two different browser tabs. The main user opens “admin”->“users” and changes the “test” user privs on the fly.
Offline
Re: Change Role on the fly when logged in for testing
Such a plugin shouldn’t be too tricky to put together (I think… but I retain the right to be wrong). The tricky part is making sure the control that allows you to switch is only visible to your nominated account and is visible (somewhere) across all priv levels — either in the header or on a dedicated Admin tab (because admin is open to all priv levels I believe). Without that, if you switched to Staff Writer you might not be able to switch back — but conversely if you just made the tab visible to all priv levels then anybody could change role :-) My guess is the user account would have to be altered inside the plugin itself after installation; don’t think there’s any other way round it.
I don’t think it’s beyond the realm of possibility to create a plugin that runs on all pages and simply overrides the privs so it appears like the currently logged in user has a different priv level than they actually have. Would have to do some testing here as it might be prohibitively difficult but if it’s possible it would be mighty handy to see what the great unwashed see without having to create many accounts.
If nobody else steps up to take this one (redbot, anyone?) I’ll give it a go and see how far I get.
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: Change Role on the fly when logged in for testing
Actually Josh, try this.
Just a noddy little beta plugin without any bells and whistles. Check the plugin help for usage. If it works ok I’ll tidy it up for general usage.
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
Offline
#9 2010-04-07 11:16:16
- uli
- Moderator
- From: Cologne
- Registered: 2006-08-15
- Posts: 4,313
Re: Change Role on the fly when logged in for testing
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
Re: Change Role on the fly when logged in for testing
Bloke wrote:
noddy little beta plugin
It’s just right. For it’s purpose I can’t think of anything else needs be done with it. Though, some may benefit from being able to have multiple users access this?
You are a Wizard.
txtstrap (Textpattern + Twitter Bootstrap + etc…)
Offline
Re: Change Role on the fly when logged in for testing
uli wrote:
The best decision to spend my 5 minutes in the forum :)
Thanks. The simple ones are often the best. My initial intention was to have it hijack the priv level but that proved far too complicated due to the fact that the core doesn’t simply grab the privs once and then keep referencing that value for each user’s credentials; it instead chooses to re-fetch the privileges from the database in numerous places throughout the page.
This is perhaps for security, but regardless of the reason behind it there are insufficient plugin hooks compared to places where the privs are re-read to make a viable hijack plugin. Hence this plugin actually does the dirty and changes the role directly in the database. With the recent addition of the auto-reinstate facility upon plugin deletion (re-fetch the plugin if you already downloaded it earlier today) this puts the cherry on top insofar as you can install it to test out how your site works without creating accounts for each priv level and then simply delete the plugin when you’re done. It’ll automatically restore your login to Publisher level and leave no trace of the plugin’s existence. All hail Robert’s plugin lifecycle platform. Hurrah!
whaleen wrote:
some may benefit from being able to have multiple users access this?
Try re-downloading the plugin. You can now specify a list of user names if you wish and each nominated person will get an Admin->Switch role tab from which they can alter their own privs. Let me know how you get on.
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: Change Role on the fly when logged in for testing
Bloke wrote:
You can now specify a list of user names if you wish and each nominated person will get an Admin->Switch role tab from which they can alter their own privs.
Very nice.
Bloke wrote:
Let me know how you get on.
Works great so far – no bugs to see. As I’m training staff very soon to use the system – this is really helping me a lot as we speak. It has been difficult to feel confident that I’ve covered everything and that the users will not be confused by unwanted stuff or missing needed stuff. When I add an extension for instance rather than having to remember to mark that off in bot_privs for Managing Editors, or any other change to the admin area, I can just put on one of the other hats and take a quick stroll through before the session is over.
As an end of day task, to tab through the admin under each role, is such a simpler way to alleviate any fears that something may go wacky when I’m away. So, I’ll be using this daily/heavily and will let you know if anything weird happens (with the plugin).
Donation coming your way on my next check. Again, you are a #wizard and I thank you!
txtstrap (Textpattern + Twitter Bootstrap + etc…)
Offline