Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Try Vanilla Forums Cloud product
Vanilla 2.6 is here! It includes security fixes and requires PHP 7.0. We have therefore ALSO released Vanilla 2.5.2 with security patches if you are still on PHP 5.6 to give you additional time to upgrade.

SettingsPermission

ShadowdareShadowdare π Moderator
edited September 2016 in Development

To define a plugin which has a settings page, we can set these two keys in the PluginInfo array:

// Define the plugin:
$PluginInfo['Example'] = array(
    ...
    'SettingsUrl' => '/settings/example',
    'SettingsPermission' => 'Garden.Settings.Manage',
    ....
);

SettingsUrl is used to display a "Settings" button next to the plugin Enable/Disable button in the dashboard.

Since the Plugins dashboard page is inherently only visible to those with Garden.Settings.Manage permission, it would seem that SettingsPermission is meant to be used for new pages created on the SettingsController.

However, in most examples of creating new pages on the SettingsController, I see that $sender->permission('Garden.Settings.Manage') is called anyway and I can't find any occurrences of the string SettingsPermission in the entire Vanilla Forums code other than plugins. Is it being used?

Add Pages to Vanilla with the Basic Pages app | Publish articles with the Articles app

Comments

Sign In or Register to comment.