Можно ли сделать запрос сразу по всем ролям пользователя без цикла?
foreach ($this->roles as $role) {
$access = (ORM::factory('Role', $role)
->permission
->where_open()
->where('directory', '=', $this->request->directory())
->or_where('directory', '=', '')
->or_where('directory', 'is', NULL)
->where_close()
->and_where_open()
->where('controller', '=', $this->request->controller())
->or_where('controller', '=', '')
->or_where('controller', 'is', NULL)
->and_where_close()
->and_where_open()
->where('action', '=', $this->request->action())
->or_where('action', '=', '')
->or_where('action', 'is', NULL)
->and_where_close()
->count_all() > 0);
if ($access)
break;
}