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

19 lines
673 B

Given /^there is the global permission (.+)? of the module (.+)?$/ do |perm_name, perm_module|
as_admin do
mapper = Redmine::AccessControl::Mapper.new
mapper.permission("new", {}, {})
Redmine::AccessControl.permissions << mapper.mapped_permissions
# map.project_module perm_module.to_sym do |mod|
# mod.permission perm_name.to_sym, {}
# end
#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)
permissions.detect{|p| p.name == perm_name.to_sym && p.global?}.should_not be_nil
end
end