summaryrefslogtreecommitdiff
path: root/app/policies/namespaces/group_project_namespace_shared_policy.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/policies/namespaces/group_project_namespace_shared_policy.rb')
-rw-r--r--app/policies/namespaces/group_project_namespace_shared_policy.rb14
1 files changed, 13 insertions, 1 deletions
diff --git a/app/policies/namespaces/group_project_namespace_shared_policy.rb b/app/policies/namespaces/group_project_namespace_shared_policy.rb
index 1ed9f05306f..bfb1706bc5a 100644
--- a/app/policies/namespaces/group_project_namespace_shared_policy.rb
+++ b/app/policies/namespaces/group_project_namespace_shared_policy.rb
@@ -2,8 +2,20 @@
module Namespaces
class GroupProjectNamespaceSharedPolicy < ::NamespacePolicy
- # Nothing here at the moment, but as we move policies from ProjectPolicy to ProjectNamespacePolicy,
+ # As we move policies from ProjectPolicy to ProjectNamespacePolicy,
# anything common with GroupPolicy but not with UserNamespacePolicy can go in here.
# See https://gitlab.com/groups/gitlab-org/-/epics/6689
+
+ condition(:timelog_categories_enabled, score: 0, scope: :subject) do
+ Feature.enabled?(:timelog_categories, @subject)
+ end
+
+ rule { ~timelog_categories_enabled }.policy do
+ prevent :read_timelog_category
+ end
+
+ rule { can?(:reporter_access) }.policy do
+ enable :read_timelog_category
+ end
end
end