docbrown/app/policies/github_repo_policy.rb
Andy Zhao ebd4b50f3f Use Preact for asynchronous rendering for /settings/integrations (#986)
* Set default styles and move button style out of form

* Add MVP of Preact /settings/integrations

* Change background color on hover and focus

* Remove unused constructor

* Improve optimistic rendering

* Add display name

* Use loading indicator for optimistic rendering

* WIP test

* Add basic snapshot tests
2018-10-31 15:51:07 -04:00

19 lines
283 B
Ruby

class GithubRepoPolicy < ApplicationPolicy
def create?
!user_is_banned?
end
def update?
!user_is_banned? && user_is_owner?
end
def permitted_attributes
%i[github_id_code featured]
end
private
def user_is_owner?
record.user_id == user.id
end
end