chore: init commit
in worker.../repo/GITFOLDER.zip is the .git folder.
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class PortfolioPolicy < ApplicationPolicy
|
||||
def show?
|
||||
return false if user.blank?
|
||||
return true if user.admin?
|
||||
return true if record.user_id == user.id
|
||||
|
||||
user.teacher? && teacher_access?
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def teacher_access?
|
||||
teacher_ids = record.user&.classroom&.teacher_ids
|
||||
teacher_ids&.include?(user.id)
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user