Skip to content

Commit

Permalink
acl: test read access for users puavoSchool attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
jpkorhonen committed Mar 8, 2016
1 parent 69bda83 commit db4c5b7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
10 changes: 10 additions & 0 deletions acl/data.rb
Expand Up @@ -94,6 +94,16 @@ def define_basic(env)
config.password = "password"
end

env.define :sysgroup_getenv do |config|
service = LdapService.new
service.uid = "testservice"
service.userPassword = "secretsecretsecretsecretsecret"
service.groups = SystemGroup.all.map{ |g| g.id }
service.save!
config.dn = service.dn
config.password = "secretsecretsecretsecretsecret"
end

env.define :student do |config|
test_image = Magick::Image.read("features/support/test.jpg").first.to_blob
student = User.new(
Expand Down
3 changes: 3 additions & 0 deletions acl/test/user_acl_test.rb
Expand Up @@ -108,6 +108,9 @@
:uid,
:uidNumber ]

sysgroup_getenv.can_read student, [ :puavoSchool ]
teacher.cannot_read other_school_student, [:puavoSchool ], InsufficientAccessRights

end

env.validate "should not allow same email for two students" do
Expand Down

0 comments on commit db4c5b7

Please sign in to comment.