Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI05-delivery/ows_framework/trunk/ows_server/ows_server/models/AccessControl.py@2643
Revision 2643,
1.0 KB
checked in by lawrence, 14 years ago
(diff) |
Starting to put stubB handling into ows/browse.
Starting to add trackback support.
|
Line | |
---|
1 | from Utilities import wrapGetText |
---|
2 | class AccessControl: |
---|
3 | |
---|
4 | ''' Handle the access control metadata and provide three attributes of the |
---|
5 | access control: exists (existence), status (modified elsewhere for whether |
---|
6 | user can access data), and html (a message about the constraints). ''' |
---|
7 | |
---|
8 | def __init__(self,e): |
---|
9 | if e is None: |
---|
10 | self.status=1 |
---|
11 | self.exist=0 |
---|
12 | self.html='' |
---|
13 | else: |
---|
14 | #for now assume everything with a simplecondition is deny |
---|
15 | self.html='Need Role: %s'%wrapGetText(e,'dgSecurityCondition/simpleCondition/attrauthRole') |
---|
16 | self.htmlLong=wrapGetText(e,'dgSecurityCondition/conditionExplanationText') |
---|
17 | sc='dgSecurityCondition/simpleCondition/' |
---|
18 | self.SimpleCondition=(wrapGetText(e,sc+'attrauthRole'), |
---|
19 | wrapGetText(e,sc+'dgAttributeAuthority')) |
---|
20 | if self.SimpleCondition==('',''): self.SimpleCondition=None |
---|
21 | self.status=0 |
---|
22 | self.exist=1 |
---|
Note: See
TracBrowser
for help on using the repository browser.