debian-mirror-gitlab/app/policies/timelog_policy.rb
2022-07-17 14:43:12 +02:00

12 lines
291 B
Ruby

# frozen_string_literal: true
class TimelogPolicy < BasePolicy
delegate { @subject.issuable }
desc "User who created the timelog"
condition(:is_author) { @user && @subject.user == @user }
rule { is_author | can?(:maintainer_access) }.policy do
enable :admin_timelog
end
end