开发者

How to deny user access to Paginator sort?

开发者 https://www.devze.com 2023-04-02 07:08 出处:网络
Is there a way to prevent user accessing sort:field url if I use paginator? I want deny sorting because I got millions of rows and it\'s really slow sorting unindexe开发者_StackOverflow中文版d fields.

Is there a way to prevent user accessing sort:field url if I use paginator? I want deny sorting because I got millions of rows and it's really slow sorting unindexe开发者_StackOverflow中文版d fields.


Simply remove the paginator link in the view. So instead of <th><?php echo $this->Paginator->sort('name');?></th> just use <th>Name</th>

The users can still sort by name, but as long as it's not a security issue, it's fine.

If you really need to prevent sorting on particular columns, or allow only on some columns, filter $this->params['url'] and $this->passedArgs (you have to remove from both of them)

0

精彩评论

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