コード例 #1
0
ファイル: template.php プロジェクト: huzairy/feedmalaya
 /**
  * Run ACL check and redirect user automatically if user doesn't have the privilege
  * 
  * @access	public
  * @param	mixed	$resource
  * @param	string	$type 
  */
 protected final function _acl($resource, $type = null)
 {
     $status = \Hybrid\Acl::access_status($resource, $type);
     switch ($status) {
         case 401:
             \Request::show_404();
             break;
     }
 }
コード例 #2
0
 /**
  * Run ACL check and redirect user automatically if user doesn't have the privilege
  * 
  * @final
  * @access  protected
  * @param   mixed   $resource
  * @param   string  $type 
  * @param   string  $name
  * @throws  HttpNotFoundException
  */
 protected final function acl($resource, $type = null, $name = null)
 {
     $acl = Acl::make($name);
     $status = $acl->access_status($resource, $type);
     switch ($status) {
         case 401:
             $acl->unauthorized($resource, false);
             exit;
             break;
     }
 }
コード例 #3
0
ファイル: rest.php プロジェクト: huzairy/feedmalaya
 /**
  * Run ACL check and redirect user automatically if user doesn't have the privilege
  * 
  * @access	public
  * @param	mixed	$resource
  * @param	string	$type 
  */
 protected final function _acl($resource, $type = null)
 {
     $status = \Hybrid\Acl::access_status($resource, $type);
     switch ($status) {
         case 401:
             $this->response(array('text' => 'You doesn\'t have privilege to do this action'), 401);
             print $this->response->body;
             exit;
             break;
     }
 }
コード例 #4
0
ファイル: user.php プロジェクト: EdgeCommerce/edgecommerce
 /**
  * Get Hybrid\Acl object, it's a quick way of get and use Hybrid\Acl without having to 
  * initiate another call when this class already has it
  * 
  * Usage:
  * 
  * <code>$role = \Hybrid\Auth::make('user')->acl();
  * $role->add_recources('monkeys');</code>
  * 
  * @access  public
  * @param   string  $name
  * @return  object
  */
 public function acl($name = null)
 {
     $this->acl = Acl::make($name);
     return $this->acl;
 }