Пример #1
0
 public function before()
 {
     parent::before();
     // Get HTML Purifier configuration
     $config = Kohana::config('purifier');
     // Do not finalize, we need to be able to set configuration options!
     $config['finalize'] = FALSE;
 }
Пример #2
0
 public function before()
 {
     parent::before();
     // Load the cookie session
     $this->session = Session::instance('cookie');
     // Get the name of the demo from the class name
     $provider = strtolower($this->api);
     // Load the provider
     $this->provider = OAuth_Provider::factory($provider);
     // Load the consumer
     $this->consumer = OAuth_Consumer::factory(Kohana::config("oauth.{$provider}"));
     if ($token = $this->session->get($this->key('access'))) {
         // Make the access token available
         $this->token = $token;
     }
 }
Пример #3
0
 public function before()
 {
     $this->acl = Bonafide::acl('blog')->resource('post', array('add', 'publish', 'delete', 'edit', 'view'))->resource('comment', array('add', 'approve', 'delete', 'view'))->role('guest')->allow('guest', 'view')->allow('guest', 'add', 'comment')->role('author', 'guest')->allow('author', 'add', 'post')->allow('author', 'approve', 'comment')->role('publisher', 'author')->allow('publisher', 'publish')->allow('publisher', 'edit', 'post')->allow('publisher', 'delete', 'comment')->role('admin')->allow('admin')->deny('admin', 'publish');
     return parent::before();
 }