20640: Merge branch 'main' into 20640-computed-permissions-api
[arvados.git] / services / api / app / controllers / arvados / v1 / computed_permissions_controller.rb
1 # Copyright (C) The Arvados Authors. All rights reserved.
2 #
3 # SPDX-License-Identifier: AGPL-3.0
4
5 class Arvados::V1::ComputedPermissionsController < ApplicationController
6   before_action :admin_required
7
8   def object_list(**args)
9     if !['none', '', nil].include?(params[:count])
10       raise ArgumentError.new("count parameter must be 'none'")
11     end
12     params[:count] = 'none'
13
14     if !['0', 0, nil].include?(params[:offset])
15       raise ArgumentError.new("non-zero offset parameter #{params[:offset].inspect} is not supported")
16     end
17
18     super
19   end
20
21   def limit_database_read(**args)
22     # This is counterproductive for this table, and the default
23     # implementation doesn't work because it relies on some
24     # real-model-like behavior that ComputedPermission does not offer.
25   end
26 end