Le mirroring des dépôts vers Github est maintenant natif dans Gitlab (et donc Framagit). Merci de passer à la fonction native pour que nous puissions couper notre solution maison. Détails sur https://docs.gitlab.com/ee/workflow/repository_mirroring.html#pushing-to-a-remote-repository (pensez à supprimer le webhook de notre solution maison).

Commit be1effbb by Alexandre Friquet

ACL can now be managed within Redmine's roles and permissions: refs #31.

parent f2885125
......@@ -18,3 +18,4 @@
* [1.0.9] Fixes incompatibility with Redmine 3.4.x (#25)
* [1.0.10] Fixes performance issue (#33)
* [1.0.10] Fixes issue with disabled transitions (#32)
* [1.O.11] Implements ACL (#31) : you will need to check them in _Administration > Roles and permissions_
......@@ -20,8 +20,9 @@ No need to define columns, your issue statuses are good enough. No need to defin
- Move the plugin to the `plugins` folder in redmine's root folder
- Install the missing gems with `bundle install` (within redmine's root folder and not redhopper's one)
- Run the migrations of the plugin: `RAILS_ENV=production bundle exec rake redmine:plugins:migrate NAME=redhopper`
2. Activate the *Kanbans* module in your project configuration.
3. Eventually, activate additional features in Redmine Administration/Plugins/Redhopper Settings.
1. Configure roles and permissions in your Redmine configuration.
1. Activate the *Kanbans* module in your project configuration.
1. Eventually, activate additional features in Redmine Administration/Plugins/Redhopper Settings.
### *Out-of-the-box* behaviour
......
......@@ -21,9 +21,9 @@
class KanbansController < ApplicationController
unloadable
def index
@project = Project.find(params[:project_id])
before_action :find_project_by_project_id, :authorize
def index
@kanban_board = KanbanBoard.new @project
@can_unsort = Feature.enabled "move_back_to_unsorted"
@hide_tracker = Feature.enabled "hide_tracker_name"
......
......@@ -19,6 +19,7 @@
# along with Redhopper. If not, see <http://www.gnu.org/licenses/>.
#
fr:
permission_kanbans: "Afficher le tableau de kanbans"
kanbans:
index:
issues_count: "Nombre de demandes."
......
......@@ -27,7 +27,7 @@ Redmine::Plugin.register :redhopper do
author_url 'http://www.infopiiaf.fr'
project_module :kanbans do
permission :kanbans, { :kanbans => [:index] }, :public => true
permission :kanbans, kanbans: :index
end
menu :project_menu, :kanbans, { :controller => 'kanbans', :action => 'index' }, :caption => 'Kanbans', :after => :activity, :param => :project_id
......
......@@ -26,7 +26,7 @@ class KanbansControllerTest < ActionController::TestCase
setup do
# Given
Feature.stubs(:enabled).returns(false)
User.current = User.find(@request.session[:user_id] = 1)
User.current = User.find(@request.session[:user_id] = 2)
Role.delete_all
@dev = Role.create!(name: 'Dev')
......@@ -47,6 +47,7 @@ class KanbansControllerTest < ActionController::TestCase
Project.delete_all
@project = Project.create! name: 'Test Project', identifier: 'test-project'
@project.enable_module!(:kanbans)
IssuePriority.delete_all
@priority = IssuePriority.create! name:'Normal'
......@@ -61,9 +62,21 @@ class KanbansControllerTest < ActionController::TestCase
@kanban_issue_todo = RedhopperIssue.create! issue: @issue_todo
@kanban_issue_doing = RedhopperIssue.create! issue: @issue_doing
@kanban_issue_done = RedhopperIssue.create! issue: @issue_done
# Permissions
Member.create_principal_memberships(User.current, {project_ids: [@project.id], role_ids: [@dev.id]})
User.current.roles.first.add_permission!("view_issues")
end
def test_index
def test_index_unauthorized
get :index, :project_id => @project.id
assert_response 403
end
def test_index_authorized
authorize_current_user
get :index, :project_id => @project.id
assert_response :success
......@@ -73,6 +86,8 @@ class KanbansControllerTest < ActionController::TestCase
end
def test_index_board_structure
authorize_current_user
get :index, :project_id => @project.id
assert_select columns, 3 do |columns|
......@@ -109,4 +124,8 @@ class KanbansControllerTest < ActionController::TestCase
def unsorted_column_cards
'ul .Kanban'
end
def authorize_current_user
User.current.roles.first.add_permission!("kanbans")
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment