2021-03-23 03:09:04 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class TimelogPolicy < BasePolicy
|
2021-06-01 21:10:06 +00:00
|
|
|
delegate { @subject.issuable }
|
2022-04-22 15:09:52 +00:00
|
|
|
|
|
|
|
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
|
2021-03-23 03:09:04 +00:00
|
|
|
end
|