Using permissions in plugins

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: Using permissions in plugins
« Reply #15, on October 25th, 2011, 01:15 PM »
I wouldn't get rid of the permissions page but we could add internal links. Just make an icon that suggests 'internal admin alias' and add links anywhere it makes sense. Including in the plugin list when a plugin is enabled. It should have aliases to any page it modifies or hooks into.

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Using permissions in plugins
« Reply #16, on October 25th, 2011, 01:29 PM »
I still don't get why there's a need to provide a link from one place to another when the setting on the other page is on the page you're putting the link in...
Re: Using permissions in plugins
« Reply #17, on October 25th, 2011, 04:22 PM »
Hmmm, curious. I knew that the inline permissions setup wasn't able to handle any/own, and that it was possible to set exclusions (like permissions that shouldn't be possible to give to guests) but I didn't realise that the exclusion was per page, not per permission.

Might have to fix that, since I want to set up a settings page with three permissions, one that should be open to any users, one that should be non-guest groups, and one that should be non guest, non regular member groups. (i.e. general access, slightly restricted and administrative type)
When we unite against a common enemy that attacks our ethos, it nurtures group solidarity. Trolls are sensational, yes, but we keep everyone honest. | Game Memorial

Re: Using permissions in plugins
« Reply #18, on October 25th, 2011, 06:50 PM »
I'm confused here as to what you are saying here. Do you mean to allow mods to have their own separate permissions page in their ACP if they want, but otherwise keeping the smaller mods inside of the normal permission page?

Since there's no doubt going to be more of smaller add-ons than larger ones there's going to be less of a need for, let's say a BBC mod, to have a separate area for permissions. However for add-ons that do require their own settings area it would make sense that the permissions would be there instead of taking up the permissions page.

It depends on the mod, I suppose. It doesn't seem to be the kind of feature where you can have it one way or the other.

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Using permissions in plugins
« Reply #19, on October 25th, 2011, 08:01 PM »
Argh.

Already, without writing a single line of extra code, permissions can be set for specific features outside the permissions area.

Grab an SMF forum. Doesn't matter what version (though if it's 2.0, be sure to turn the calendar on), then go to the calendar settings. In there, there is a collection of permissions for the calendar.

You don't even have to revisit the permissions page to set them, you just configure the calendar right there, its settings and its permissions.

Now imagine that the calendar is a plugin. It will be eventually but right now that's hypothetical. Anyway, the calendar is a plugin, you enable it, an icon appears in the Plugins area in the ACP (menu included), where all the settings are.

My central point is that if you are defining a page in the admin for something, why is there a need to put part of its configuration in one place and part in another? Especially when it is not immediately obvious what is going on and causes so many questions for users.

This lead me to wonder if, in fact, it would be better not to allow the main permissions to be directly configurable and force plugins to contain all their permissions in their own configuration area.

There are not that many cases where a plugin would add a permission and no other settings whatsoever, in fact I can only think of about 3 cases I've seen where it would come up and even then, it still requires more work than just setting up a permission anyway.

I would note that plugins having their own permissions/settings area is not unheard of, nor is it unheard of to force them to do that. WordPress operates on that sort of principle, as does iOS, and for good reason.

Nao

  • Dadman with a boy
  • Posts: 16,082

godboko71

  • Fence accomplished!
  • Hello
  • Posts: 361
Re: Using permissions in plugins
« Reply #21, on October 26th, 2011, 12:43 AM »
I like the idea of plugins having there own permissions page. The only time that might be a drag is if one adds a new group or something down the line. How ever that is rare, Maybe a link on the (core) permissions page to the (each) plugins permissions page to make it slightly easier.
Thank you,
Boko

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Using permissions in plugins
« Reply #22, on October 26th, 2011, 12:47 AM »
Quote
I like the idea of plugins having there own permissions page
For most plugins it's not even a full page, it's literally one line in the settings page, as the calendar does.
Quote
The only time that might be a drag is if one adds a new group or something down the line. How ever that is rare
True enough, though I'd argue that generally a new group is created to manage a new role within the forum environment, and if you copy from an existing group/role/whatever, that would actually solve that problem too. (It works, though it feels inelegant, in SimpleDesk)
Quote
Maybe a link on the (core) permissions page to the (each) plugins permissions page to make it slightly easier.
I honestly can't think of a less effective way to do it, to the point where not providing a link would almost be better. Since it would require each plugin indicating its permissions UI to the core UI (and we all know how badly mod authors generally do at 'doing any more work than they absolutely have to'), I might as well just encourage them not to bridge the two like that, and instead just have them integrate permissions into the core UI through the normal fashion. No point reinventing the wheel like that.

PantsManUK

  • [me=PantsManUK]would dearly love to dump SMF 1.X at this juncture...[/me]
  • Posts: 174
Re: Using permissions in plugins
« Reply #23, on October 26th, 2011, 10:37 AM »Last edited on October 26th, 2011, 11:00 AM by PantsManUK
Quote from Arantor on October 26th, 2011, 12:47 AM
I honestly can't think of a less effective way to do it, to the point where not providing a link would almost be better. Since it would require each plugin indicating its permissions UI to the core UI (and we all know how badly mod authors generally do at 'doing any more work than they absolutely have to'), I might as well just encourage them not to bridge the two like that, and instead just have them integrate permissions into the core UI through the normal fashion. No point reinventing the wheel like that.
Hence my "no permissions page" thought experiment. If there is no permissions page, and the expectation for plugin devs is "you need to make yourself a permissions block of some sort in your settings page, or if you have lots of permissions make yourself a permissions page/tab/whatever off your settings page", everyone will get used to this way of working.

EDIT: added four extra words that make it even more clear what the thought experiment expectation is.
« What is this thing you hoomans call "Facebook"? »

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Using permissions in plugins
« Reply #24, on October 26th, 2011, 10:42 AM »
And yeah, that's what I suspected you were getting at. Just that for some things right now that isn't practical. But it does make for interesting thoughts about how some things should work.