    def test_repository_swap_detection(self):
        self.create_test_files()
        os.environ['ATTIC_PASSPHRASE'] = 'passphrase'
        self.attic('init', '--encryption=passphrase', self.repository_location)
        repository_id = self._extract_repository_id(self.repository_path)
        self.attic('create', self.repository_location + '::test', 'input')
        shutil.rmtree(self.repository_path)
        self.attic('init', '--encryption=none', self.repository_location)
        self._set_repository_id(self.repository_path, repository_id)
        self.assert_equal(repository_id, self._extract_repository_id(self.repository_path))
        self.assert_raises(Cache.EncryptionMethodMismatch, lambda :self.attic('create', self.repository_location + '::test.2', 'input'))
Weaknesses in this category are related to the management of permissions, privileges, and other security features that are used to perform access control.