/** * Authorize the grid. * * @param GridBuilder $builder */ public function authorize(GridBuilder $builder) { // Try the option first. $permission = $builder->getGridOption('permission'); /* * If the option is not set then * try and automate the permission. */ if (!$permission && ($module = $this->modules->active()) && ($stream = $builder->getGridStream())) { $permission = $module->getNamespace($stream->getSlug() . '.read'); } if (!$this->authorizer->authorize($permission)) { abort(403); } }