Add backend for tips and enable markdown support
This commit is contained in:
13
app/policies/tip_policy.rb
Normal file
13
app/policies/tip_policy.rb
Normal file
@ -0,0 +1,13 @@
|
||||
class TipPolicy < AdminOnlyPolicy
|
||||
|
||||
class Scope < Scope
|
||||
def resolve
|
||||
if @user.admin? || @user.teacher?
|
||||
@scope.all
|
||||
else
|
||||
@scope.none
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
Reference in New Issue
Block a user