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

How can I make this plugin ONLY for Admin?

This discussion is related to the CLEditor jQuery WYSIWYG addon.
DogHamDogHam
edited February 2014 in Vanilla 2.0 - 2.8

I'm using v2.1b2 version and the version 0.5 of cleditor plugin.

Comments

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    I think this is where you need to add those, but I may be off(more than likely). You can compare how other plugins have it or experiment.

    class cleditorPlugin extends Gdn_Plugin {
    
        public function PostController_Render_Before($Sender) {
    $IsAdmin = Gdn::Session()->CheckPermission('Garden.Users.Edit');
       if(!$IsAdmin) return;
    $this->_AddCLEditor($Sender);
        }
    
        public function DiscussionController_Render_Before($Sender) {
    $IsAdmin = Gdn::Session()->CheckPermission('Garden.Users.Edit');
       if(!$IsAdmin) return;
    $this->Permission('Garden.Settings.Manage');    
            $this->_AddCLEditor($Sender);
        }
    
    DogHam
  • Thank you I will try :)

    [Deleted User]
Sign In or Register to comment.