diff options
author | Andreas Gohr <andi@splitbrain.org> | 2012-06-30 14:19:51 +0200 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2012-06-30 14:20:51 +0200 |
commit | 32e82180a785b09b1886cf44ecca5ed22ce37b9d (patch) | |
tree | 2e759bdab80a1cdfab92207ae1c406ee613e605c /_test/tests | |
parent | 772c924913365ea9be90e667f6d06cdcef3ab4ec (diff) | |
download | rpg-32e82180a785b09b1886cf44ecca5ed22ce37b9d.tar.gz rpg-32e82180a785b09b1886cf44ecca5ed22ce37b9d.tar.bz2 |
fixed group wildcards and added tests
Diffstat (limited to '_test/tests')
-rw-r--r-- | _test/tests/inc/auth_aclcheck.test.php | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/_test/tests/inc/auth_aclcheck.test.php b/_test/tests/inc/auth_aclcheck.test.php index ea48ec6a5..991f82da7 100644 --- a/_test/tests/inc/auth_aclcheck.test.php +++ b/_test/tests/inc/auth_aclcheck.test.php @@ -235,6 +235,33 @@ class auth_acl_test extends DokuWikiTest { $this->assertEquals(auth_aclcheck('namespace:*', 'jill',array('foo','roots')), AUTH_ADMIN); } + function test_wildcards(){ + global $conf; + global $AUTH_ACL; + global $USERINFO; + $conf['useacl'] = 1; + + $_SERVER['REMOTE_USER'] = 'john'; + $USERINFO['grps'] = array('test','töst','foo bar'); + $AUTH_ACL = auth_loadACL(); // default test file + + // default setting + $this->assertEquals(AUTH_UPLOAD, auth_aclcheck('page', $_SERVER['REMOTE_USER'], $USERINFO['grps'])); + + // user namespace + $this->assertEquals(AUTH_DELETE, auth_aclcheck('users:john:foo', $_SERVER['REMOTE_USER'], $USERINFO['grps'])); + $this->assertEquals(AUTH_READ, auth_aclcheck('users:john:foo', 'schmock', array())); + + // group namespace + $this->assertEquals(AUTH_DELETE, auth_aclcheck('groups:test:foo', $_SERVER['REMOTE_USER'], $USERINFO['grps'])); + $this->assertEquals(AUTH_READ, auth_aclcheck('groups:test:foo', 'schmock', array())); + $this->assertEquals(AUTH_DELETE, auth_aclcheck('groups:toest:foo', $_SERVER['REMOTE_USER'], $USERINFO['grps'])); + $this->assertEquals(AUTH_READ, auth_aclcheck('groups:toest:foo', 'schmock', array())); + $this->assertEquals(AUTH_DELETE, auth_aclcheck('groups:foo_bar:foo', $_SERVER['REMOTE_USER'], $USERINFO['grps'])); + $this->assertEquals(AUTH_READ, auth_aclcheck('groups:foo_bar:foo', 'schmock', array())); + + } + } //Setup VIM: ex: et ts=4 : |