Welcome to mirror list, hosted at ThFree Co, Russian Federation.

todo_policy.rb « policies « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f8644217f043445f74c24c9e9793c713d0b1889b (plain)
1
2
3
4
5
6
7
8
9
10
# frozen_string_literal: true

class TodoPolicy < BasePolicy
  desc 'User can only read own todos'
  condition(:own_todo) do
    @user && @subject.user_id == @user.id
  end

  rule { own_todo }.enable :read_todo
end