forked from ptahproject/ptah
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
allow to use role for access to ptah-manage; removed make_wsgi_app
- Loading branch information
Showing
11 changed files
with
77 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,7 +40,7 @@ class TestModule(PtahModule): | |
|
||
self.init_ptah() | ||
|
||
set_access_manager(PtahAccessManager) | ||
set_access_manager(PtahAccessManager()) | ||
|
||
MODULES = config.get_cfg_storage(MANAGE_ID) | ||
self.assertIn('test-module', MODULES) | ||
|
@@ -51,7 +51,7 @@ class TestModule(PtahModule): | |
|
||
self.assertRaises(HTTPForbidden, PtahManageRoute, self.request) | ||
|
||
def accessManager(id): | ||
def accessManager(id, request): | ||
return True | ||
|
||
set_access_manager(accessManager) | ||
|
@@ -72,11 +72,11 @@ def test_manage_access_manager1(self): | |
cfg = ptah.get_settings(ptah.CFG_ID_PTAH, self.registry) | ||
cfg['managers'] = ['*'] | ||
|
||
self.assertTrue(PtahAccessManager('test:user')) | ||
self.assertTrue(PtahAccessManager()('test:user', self.request)) | ||
|
||
cfg['managers'] = ['[email protected]'] | ||
|
||
self.assertFalse(PtahAccessManager('test:user')) | ||
self.assertFalse(PtahAccessManager()('test:user', self.request)) | ||
|
||
def test_manage_access_manager2(self): | ||
from ptah.manage.manage import PtahAccessManager | ||
|
@@ -95,7 +95,7 @@ def principalResolver(uri): | |
|
||
cfg = ptah.get_settings(ptah.CFG_ID_PTAH, self.registry) | ||
cfg['managers'] = ['[email protected]'] | ||
self.assertTrue(PtahAccessManager('test:user')) | ||
self.assertTrue(PtahAccessManager()('test:user', self.request)) | ||
|
||
def test_manage_view(self): | ||
from ptah.manage.manage import \ | ||
|
@@ -108,7 +108,7 @@ class TestModule(PtahModule): | |
|
||
title = 'Test module' | ||
|
||
def accessManager(id): | ||
def accessManager(id, request): | ||
return True | ||
|
||
self.init_ptah() | ||
|
@@ -137,7 +137,7 @@ class TestModule(PtahModule): | |
def available(self): | ||
return False | ||
|
||
def accessManager(id): | ||
def accessManager(id, request): | ||
return True | ||
|
||
self.init_ptah() | ||
|
@@ -167,7 +167,7 @@ class TestModule(PtahModule): | |
|
||
title = 'Test module' | ||
|
||
def accessManager(id): | ||
def accessManager(id, request): | ||
return True | ||
|
||
self.init_ptah() | ||
|
@@ -190,7 +190,7 @@ class TestModule(PtahModule): | |
|
||
title = 'Test module' | ||
|
||
def accessManager(id): | ||
def accessManager(id, request): | ||
return True | ||
|
||
self.init_ptah() | ||
|
@@ -220,7 +220,7 @@ class TestModule(PtahModule): | |
|
||
title = 'Test module' | ||
|
||
def accessManager(id): | ||
def accessManager(id, request): | ||
return True | ||
|
||
self.init_ptah() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters