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: d01a046c34398b11fbdb8b4ef5b9b985806551e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
# 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
  rule { own_todo }.enable :update_todo
end