Make predefined rights plugins more restrictive and remove NoneAuth
Collections with tag are only allowed as direct children of a principal collections.
This commit is contained in:
@@ -1428,6 +1428,16 @@ class BaseFileSystemTest(BaseTest):
|
||||
self.configuration["storage"]["filesystem_folder"] = self.colpath
|
||||
# Disable syncing to disk for better performance
|
||||
self.configuration["internal"]["filesystem_fsync"] = "False"
|
||||
# Allow access to anything for tests
|
||||
rights_file_path = os.path.join(self.colpath, "rights")
|
||||
with open(rights_file_path, "w") as f:
|
||||
f.write("""\
|
||||
[allow all]
|
||||
user: .*
|
||||
collection: .*
|
||||
permissions: RrWw""")
|
||||
self.configuration["rights"]["file"] = rights_file_path
|
||||
self.configuration["rights"]["type"] = "from_file"
|
||||
self.application = Application(self.configuration)
|
||||
|
||||
def teardown(self):
|
||||
|
||||
@@ -99,18 +99,6 @@ class TestBaseAuthRequests(BaseTest):
|
||||
self._test_rights("authenticated", "tmp", "/other", "r", 207)
|
||||
self._test_rights("authenticated", "tmp", "/other", "w", 207)
|
||||
|
||||
def test_none(self):
|
||||
self._test_rights("none", "", "/", "r", 207)
|
||||
self._test_rights("none", "", "/", "w", 207)
|
||||
self._test_rights("none", "", "/tmp", "r", 207)
|
||||
self._test_rights("none", "", "/tmp", "w", 207)
|
||||
self._test_rights("none", "tmp", "/", "r", 207)
|
||||
self._test_rights("none", "tmp", "/", "w", 207)
|
||||
self._test_rights("none", "tmp", "/tmp", "r", 207)
|
||||
self._test_rights("none", "tmp", "/tmp", "w", 207)
|
||||
self._test_rights("none", "tmp", "/other", "r", 207)
|
||||
self._test_rights("none", "tmp", "/other", "w", 207)
|
||||
|
||||
def test_from_file(self):
|
||||
rights_file_path = os.path.join(self.colpath, "rights")
|
||||
with open(rights_file_path, "w") as f:
|
||||
|
||||
Reference in New Issue
Block a user