Skip to content

Best way to implement a "superadmin" handling? #223

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
progS1m opened this issue Jun 9, 2016 · 4 comments
Closed

Best way to implement a "superadmin" handling? #223

progS1m opened this issue Jun 9, 2016 · 4 comments

Comments

@progS1m
Copy link

progS1m commented Jun 9, 2016

In my bot project I search for a way to tread users ("superadmins") differently. The "superadmins" should coexist with the admins. They should be able to see / use some more commands than default users / admins can see (like this already implemented in the admin feature).

What is the most efficient way to implement this?

Should I make a copy of all related enableAdmins classes? Because I'm very new to php I
worry that I will fail.

Can someone give me some advices.

I would be very grateful! Thank you.

@noplanman
Copy link
Member

As it is implemented now with the User and Admin commands, it's not possible to have a Superadmin one.

What you could do though, if have an Admin command that first checks to see if the user is a Superadmin.
Obviously all Admins would be able to see the command in the help list and call it, but they'd get an answer like "You are not authorised" or something.

Another possibility, as you suggested yourself, would be to adapt the code and duplicate everything that exists for Admin and call it Superadmin. That will work, but will need a lot of code modifications.

Regarding your worry of failing, if you don't try you've already failed!
So just give it a try and see 😃👍

@progS1m
Copy link
Author

progS1m commented Jun 12, 2016

I've implemented your first mentioned idea. It was easy to implement and is sufficient for my needs.

Thanks for your answer! 👍

@progS1m progS1m closed this as completed Jun 12, 2016
@noplanman
Copy link
Member

Ok 👍

@MBoretto @jacklul @akalongman
Maybe we implement a SuperAdmin group into the library some day? What do you think?

@MBoretto
Copy link
Collaborator

Would be nice to have different levels of admin permissions! Could be introduced with the commander class!
#93
#106

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants