开发者

Setting authorization levels using Rest Server extension for CodeIgniter

开发者 https://www.devze.com 2023-04-05 16:28 出处:网络
I\'m using the Rest Server (https://github.com/philsturgeon/codeigniter-restserver) extension for Code开发者_如何学GoIgniter and I\'m struggling to find examples on how to set the authorization level

I'm using the Rest Server (https://github.com/philsturgeon/codeigniter-restserver) extension for Code开发者_如何学GoIgniter and I'm struggling to find examples on how to set the authorization level within a method.

I've tried all of the following:

public function index_get()
{
    $this->methods['index']['level'] = 10;
    $this->methods['level'] = 10;
    $this->rest->level = 10;
    $this->level = 10;
}

With no luck. Examples appreciated. Thanks!


The following protected method needs to go at the top of the API controller. Here you can specify the authorization level for each method and the rate limit.

   protected $methods = array(
           'index_get' => array('level' => 10),
           'types_get' => array('level' => 10, 'limit' => 20),
   );
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号