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