web/schemaviewer.py
branchstable
changeset 5460 52ae8f68d9e2
parent 5426 0d4853a6e5ee
child 7152 39c1ffc7d93f
equal deleted inserted replaced
5459:6e561796804c 5460:52ae8f68d9e2
    46             self._ = unicode
    46             self._ = unicode
    47         self.encoding = encoding
    47         self.encoding = encoding
    48 
    48 
    49     # no self.req managements
    49     # no self.req managements
    50 
    50 
    51     def may_read(self, rdef, action):
    51     def may_read(self, rdef, action='read'):
    52         """Return true if request user may read the given schema.
    52         """Return true if request user may read the given schema.
    53         Always return True when no request is provided.
    53         Always return True when no request is provided.
    54         """
    54         """
    55         if self.req is None:
    55         if self.req is None:
    56             return True
    56             return True
    57         return sch.may_have_permission('read', self.req)
    57         return rdef.may_have_permission(action, self.req)
    58 
    58 
    59     def format_eschema(self, eschema):
    59     def format_eschema(self, eschema):
    60         text = eschema.type
    60         text = eschema.type
    61         if self.req is None:
    61         if self.req is None:
    62             return Text(text)
    62             return Text(text)