Handle when permitted is set as "everyone"
Dieser Commit ist enthalten in:
Ursprung
6a469b2e50
Commit
e7a1472a1c
2 geänderte Dateien mit 8 neuen und 0 gelöschten Zeilen
|
@ -166,6 +166,7 @@ class CustomWizard::Wizard
|
||||||
|
|
||||||
mapper.all? do |m|
|
mapper.all? do |m|
|
||||||
if m[:type] === 'assignment'
|
if m[:type] === 'assignment'
|
||||||
|
[*m[:result]].include?(Group::AUTO_GROUPS[:everyone]) ||
|
||||||
GroupUser.exists?(group_id: m[:result], user_id: user.id)
|
GroupUser.exists?(group_id: m[:result], user_id: user.id)
|
||||||
elsif m[:type] === 'validation'
|
elsif m[:type] === 'validation'
|
||||||
m[:result]
|
m[:result]
|
||||||
|
|
|
@ -98,6 +98,13 @@ describe CustomWizard::Wizard do
|
||||||
CustomWizard::Wizard.new(@permitted_template, trusted_user).permitted?
|
CustomWizard::Wizard.new(@permitted_template, trusted_user).permitted?
|
||||||
).to eq(true)
|
).to eq(true)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "permits everyone if everyone is permitted" do
|
||||||
|
@permitted_template['permitted'][0]['output'] = Group::AUTO_GROUPS[:everyone]
|
||||||
|
expect(
|
||||||
|
CustomWizard::Wizard.new(@permitted_template, user).permitted?
|
||||||
|
).to eq(true)
|
||||||
|
end
|
||||||
|
|
||||||
it "does not permit unpermitted users" do
|
it "does not permit unpermitted users" do
|
||||||
expect(
|
expect(
|
||||||
|
|
Laden …
In neuem Issue referenzieren