19 lines
223 B
Ruby
19 lines
223 B
Ruby
|
# policies/subcreddit_policy.rb
|
||
|
class SubcredditPolicy < ApplicationPolicy
|
||
|
def index?
|
||
|
true
|
||
|
end
|
||
|
|
||
|
def show?
|
||
|
true
|
||
|
end
|
||
|
|
||
|
def create?
|
||
|
user.registered?
|
||
|
end
|
||
|
|
||
|
def update?
|
||
|
record.owner == user
|
||
|
end
|
||
|
end
|