OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
openproject/features/step_definitions/global_roles.rb

15 lines
618 B

Given /^there is the global permission "(.+)?" of the module "(.+)?"$/ do |perm_name, perm_module|
Redmine::AccessControl.map do |map|
map.project_module perm_module.to_sym do |mod|
mod.permission perm_name.to_sym, {:dont => :care}, {:project_module => perm_module.to_sym, :global => true}
end
end
end
Given /^the global permission "(.+)?" of the module "(.+)?" is defined$/ do |perm_name, perm_module|
as_admin do
permissions = Redmine::AccessControl.modules_permissions(perm_module)
debugger
permissions.detect{|p| p.name == perm_name.to_sym && p.global?}.should_not be_nil
end
end