|
200 | 200 | it { expect(member_ability_with_write_permission).to be_able_to(:update_site_property, field, site) } |
201 | 201 | it { expect(member_ability_with_write_permission).to be_able_to(:read_site_property, field, site) } |
202 | 202 | end |
| 203 | + |
| 204 | + context "Site creation" do |
| 205 | + it "can't create sites if it doesn't have write permissions" do |
| 206 | + membership.set_access({object: 'name', new_action: 'read'}) |
| 207 | + membership.set_access({object: 'location', new_action: 'read'}) |
| 208 | + |
| 209 | + expect(member_ability).not_to be_able_to(:create_site, collection) |
| 210 | + end |
| 211 | + |
| 212 | + it "can't create sites if it doesn't have both write permissions" do |
| 213 | + membership.set_access({object: 'name', new_action: 'update'}) |
| 214 | + membership.set_access({object: 'location', new_action: 'read'}) |
| 215 | + |
| 216 | + expect(member_ability).not_to be_able_to(:create_site, collection) |
| 217 | + end |
| 218 | + |
| 219 | + it "can't create sites if it doesn't have both write permissions" do |
| 220 | + membership.set_access({object: 'name', new_action: 'read'}) |
| 221 | + membership.set_access({object: 'location', new_action: 'update'}) |
| 222 | + |
| 223 | + expect(member_ability).not_to be_able_to(:create_site, collection) |
| 224 | + end |
| 225 | + |
| 226 | + it "can create sites if it has both write permissions" do |
| 227 | + membership.set_access({object: 'name', new_action: 'update'}) |
| 228 | + membership.set_access({object: 'location', new_action: 'update'}) |
| 229 | + |
| 230 | + expect(member_ability).to be_able_to(:create_site, collection) |
| 231 | + end |
| 232 | + end |
203 | 233 | end |
204 | 234 |
|
205 | 235 | describe "guest user should not be able to update site property" do |
|
0 commit comments