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.
30 lines
473 B
30 lines
473 B
class BulkUploadPolicy |
|
attr_reader :user, :bulk_upload |
|
|
|
def initialize(user, bulk_upload) |
|
@user = user |
|
@bulk_upload = bulk_upload |
|
end |
|
|
|
def summary? |
|
owner? || same_org? || user.support? |
|
end |
|
|
|
def show? |
|
owner? || same_org? || user.support? |
|
end |
|
|
|
def resume? |
|
owner? || same_org? || user.support? |
|
end |
|
|
|
private |
|
|
|
def owner? |
|
bulk_upload.user == user |
|
end |
|
|
|
def same_org? |
|
bulk_upload.user.organisation.users.include?(user) |
|
end |
|
end
|
|
|