2015-03-18 22:02:38 +00:00
|
|
|
class KeyPairPolicy < ApplicationPolicy
|
|
|
|
|
|
|
|
def create?
|
2015-04-02 22:47:45 +01:00
|
|
|
return false unless record.repository
|
|
|
|
is_admin? || local_admin?(record.repository.platform)
|
2015-03-18 22:02:38 +00:00
|
|
|
end
|
2015-04-02 22:47:45 +01:00
|
|
|
alias_method :destroy?, :create?
|
2015-03-18 22:02:38 +00:00
|
|
|
|
|
|
|
end
|