chore: init commit
in worker.../repo/GITFOLDER.zip is the .git folder.
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class GradeBookPolicy < ApplicationPolicy
|
||||
def update?
|
||||
user_is_teacher_of_classroom? || user.admin?
|
||||
end
|
||||
|
||||
def show?
|
||||
user_is_teacher_of_classroom? || user.admin?
|
||||
end
|
||||
|
||||
def finalize?
|
||||
user.admin?
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def user_is_teacher_of_classroom?
|
||||
user.teacher? && record.classroom.teachers.include?(user)
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user