ElkArte Community

Extending Elk => Addons => Topic started by: [SiNaN] on July 28, 2014, 01:35:06 pm

Title: [ADDON] Switch Permissions
Post by: [SiNaN] on July 28, 2014, 01:35:06 pm
This mod allows admins to switch to permissions of another user on the forum. In order to switch permissions, you need to click the switch permissions button on members' profile summary.

So I got around to porting one of my favorite mods. I guess I could have used some of the hooks there but since I had to edit some files, I didn't bother. Let me know if there are any issues.


http://addons.elkarte.net/admin/Switch-Permissions.html
Title: Re: [ADDON] Switch Permissions
Post by: Adrek on July 28, 2014, 02:23:59 pm
Works great :) Thanks for porting it to ElkArte.
Title: Re: [ADDON] Switch Permissions
Post by: emanuele on July 28, 2014, 02:58:38 pm
/me likes!

/me wonders if it could go into 1.1 at some point... O:-)
Title: Re: [ADDON] Switch Permissions
Post by: Spuds on July 28, 2014, 05:56:09 pm
This is very cool .. how did I not know about this one, so useful!
Title: Re: [ADDON] Switch Permissions
Post by: Jorin on July 29, 2014, 01:49:30 am
Please explain... Is this mod to check if you - as admin - have set the permissions of another group right without the need to logout and login with a test user? You can switch your group, check the permissions, and switch back to admin group?
Title: Re: [ADDON] Switch Permissions
Post by: [SiNaN] on July 29, 2014, 06:20:46 am
Quote from: emanuele – /me wonders if it could go into 1.1 at some point... O:-)

That would be great actually. Feel free to use the code as you wish in case you decide to add such a feature.

Quote from: Spuds – This is very cool .. how did I not know about this one, so useful!

The idea is from another forum I'm the admin of. It's very handy when dealing with permissions.

Quote from: Jorin – Please explain... Is this mod to check if you - as admin - have set the permissions of another group right without the need to logout and login with a test user? You can switch your group, check the permissions, and switch back to admin group?

Yeah, it's pretty much as you've described. Without logging out, you assume the groups of a selected member. I have added two screenshots to the first post to make it a little more clear.
Title: Re: [ADDON] Switch Permissions
Post by: meetdilip on July 29, 2014, 11:23:59 am
Great feature. Thanks @[SiNaN]
Title: Re: [ADDON] Switch Permissions
Post by: radu81 on November 18, 2014, 03:49:41 am
very nice mod and useful for testing permissions. No more test accounts ;)
Title: Re: [ADDON] Switch Permissions
Post by: radu81 on January 06, 2015, 11:00:17 am
I tried this addon and I found a bug, or at least I think so ;)

I have a board with custom permissions. Only on that board people can edit their post. I did a test with a normal account and I can confirm that permissions are ok so people can edit their posts. When I switch permission to a user I can't see the Edit button. Is this normal?
Title: Re: [ADDON] Switch Permissions
Post by: Joshua Dickerson on July 15, 2015, 04:47:07 am
@[SiNaN], I was just looking at this mod and I noticed that it could definitely use hooks.

In Load.php, "integrate_user_info" but you have to duplicate some efforts. I think we should break down the loading of the groups in to a separate function and then add a hook in there for that. Then switch_membergroups() should use a separate file (where you can also put the hook callbacks and action switchpermissions())

SiteDispatcher is an easy one. integrate_actions

Instead of editing Addons.english.php, just load your own language file.

I don't see any way to get around the Security.php edits.
Title: Re: [ADDON] Switch Permissions
Post by: Flavio93Zena on July 22, 2015, 08:37:26 pm
Also, please test it properly, it has some non-reported bugs that I discovered that drove me really mad as it leaded me to think I had screwed the permissions but it was the mod being at fault. The issue if I remember correctly is that it was giving me access to the mod center despite not being a mod (but a former one, on my test account). Don't ask me for steps to reproduce now, because I've done a looooot of mess with it,  just test it though, please.
Not sure if they are related to other mods being in conflict with it, probably, but not sure why nor which ones, if so.