You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
483 B
17 lines
483 B
1 month ago
|
class CsvDownloadPolicy
|
||
|
attr_reader :current_user, :csv_download
|
||
|
|
||
|
def initialize(current_user, csv_download)
|
||
|
@current_user = current_user
|
||
|
@csv_download = csv_download
|
||
|
end
|
||
|
|
||
|
def show?
|
||
|
@current_user == @csv_download.user || @current_user.support? || @current_user.organisation == @csv_download.organisation
|
||
|
end
|
||
|
|
||
|
def download?
|
||
|
@current_user == @csv_download.user || @current_user.support? || @current_user.organisation == @csv_download.organisation
|
||
|
end
|
||
|
end
|