debian-mirror-gitlab/app/policies/timelog_policy.rb
2022-07-16 19:58:13 +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