Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

WYSIWYG plugin

It's possible to make WYSIWYG plugin ONLY for admin?

Thank you

Comments

  • peregrineperegrine MVP
    edited February 2014

    just test for the admin role and return or exit from plugin if not admin.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • But in "Roles & Permissions" i don't have the WYSIWYG plugin

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    no he means to add a permissions requirement in the plugin. Something like this

    'RegisterPermissions' => array('Garden.Settings.Manage')

    Then in the render part this check

    $UserHasPermission = Gdn::Session()->CheckPermission('Garden.Settings.Manage', TRUE); if($UserHasPermission) {

  • oh sorry... but this is not for noobs like me :D

  • peregrineperegrine MVP
    edited February 2014

    'RegisterPermissions' => array('Garden.Settings.Manage')

    Actually you don't need to mess with RegisterPermissions, that doesn't deal with it.

      $IsAdmin = Gdn::Session()->CheckPermission('Garden.Users.Edit');
       if(!$IsAdmin) return;
    

    I don't know what version of vanilla you are using or the plugin you are talking about. So I can't give specifics

    so repost your question where it belongs. and ...

    • 1 If the question is about a specific plugin post your question under the plugin you are asking about.

    • 2 state the version of the plugin AND your version of vanilla.

    if you say latest - you will be ignored.

    otherwise the answers above should be sufficient.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Thank you for the tip with "latest version" ^^

    Link to the Question

Sign In or Register to comment.