mirror of
https://github.com/opf/openproject.git
synced 2026-06-13 19:20:00 +00:00
Implement stub controller for Resource Allocations
This commit is contained in:
+53
@@ -0,0 +1,53 @@
|
||||
# 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.
|
||||
#++
|
||||
module ::ResourceManagement
|
||||
class ResourceAllocationsController < BaseController
|
||||
include OpTurbo::ComponentStream
|
||||
|
||||
menu_item :resource_management
|
||||
|
||||
before_action :find_project_by_project_id
|
||||
before_action :authorize
|
||||
|
||||
# The modals and the ResourceAllocations::* contracts/services are wired up
|
||||
# in follow-up work. For now these are stubs so the routes and the
|
||||
# `allocate_user_resources` permission have something to bind to.
|
||||
|
||||
def new; end
|
||||
|
||||
def edit; end
|
||||
|
||||
def create; end
|
||||
|
||||
def update; end
|
||||
|
||||
def destroy; end
|
||||
end
|
||||
end
|
||||
@@ -62,5 +62,9 @@ Rails.application.routes.draw do
|
||||
get "menu" => "resource_management/menus#show"
|
||||
end
|
||||
end
|
||||
|
||||
resources :resource_allocations,
|
||||
controller: "resource_management/resource_allocations",
|
||||
only: %i[new create edit update destroy]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -72,12 +72,12 @@ module OpenProject::ResourceManagement
|
||||
dependencies: %i[view_resource_planners]
|
||||
|
||||
# `allocate_user_resources` gates create/update/delete on
|
||||
# ResourceAllocation records. No controller actions yet — the
|
||||
# ResourceAllocations::*Contract classes consume this directly via
|
||||
# `allowed_in_project?`. The `contract_actions` map keeps the
|
||||
# ResourceAllocation records, both via the controller actions below and
|
||||
# directly in the ResourceAllocations::*Contract classes (which consume
|
||||
# it through `allowed_in_project?`). The `contract_actions` map keeps the
|
||||
# permission discoverable for API contracts.
|
||||
permission :allocate_user_resources,
|
||||
{},
|
||||
{ "resource_management/resource_allocations": %i[new create edit update destroy] },
|
||||
permissible_on: :project,
|
||||
dependencies: %i[view_resource_planners],
|
||||
contract_actions: { resource_allocation: %i[create update destroy] }
|
||||
|
||||
Reference in New Issue
Block a user