Files
openproject/modules/backlogs/app/contracts/backlog_buckets/base_contract.rb
T
Marcello Rocha d03d22edc8 Implements the GET /work_packages/:id/wiki_page_links endpoint (#22834)
* Introduce the PageLinkQuery
* Update page link query and some copyright
* Adds PageLinkCollectionRepresenter
* Introduces the endpoint /work_packages/id/wiki_page_links
* MetadaService tests, most of it is a work of fiction
* Adds urns for page link type improve some tests
* Removes mentions to view_wiki_page_links permissions
* Adds a test for multiple providers and same identifiers

---

Co-authored-by: Jan Sandbrink <j.sandbrink@openproject.com>
2026-05-08 17:38:52 +02:00

50 lines
1.5 KiB
Ruby

# frozen_string_literal: true
#-- copyright
# OpenProject is an open source project management software.
# Copyright (C) the OpenProject GmbH
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 3.
#
# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
# Copyright (C) 2006-2013 Jean-Philippe Lang
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# See COPYRIGHT and LICENSE files for more details.
#++
class BacklogBuckets::BaseContract < ModelContract
validate :user_authorized
def self.model
BacklogBucket
end
attribute :name
private
def user_authorized
return unless model.project
unless user.allowed_in_project?(:create_sprints, model.project)
errors.add :base, :error_unauthorized
end
end
end