Example #1
0
 /**
  * Filter menu items based on Shinobi permissions.
  *
  * @return Builder
  */
 public function guard()
 {
     if (class_exists('Caffeinated\\Shinobi\\Shinobi')) {
         $this->filter(function ($item) {
             if (!$item->data('can') and !$item->data('canatleast')) {
                 return true;
             } elseif ($item->data('canatleast')) {
                 return \Shinobi::canAtLeast($item->data('canatleast'));
             } else {
                 return \Shinobi::can($item->data('can'));
             }
         });
     }
     return $this;
 }
Example #2
0
 /**
  * Using Shinobi Authorization Driver
  * 
  * @param  [string] $permission
  * @param  [mixed] $arguments	Additional arguments to pass
  * @package Caffeinated\Shinobi
  * @return boolean
  */
 protected function aclShinobi($permission, $arguments)
 {
     return \Shinobi::can($permission, $arguments);
 }