Revision 5d0b2888 lib/build/sphinx_ext.py

b/lib/build/sphinx_ext.py
68 68

  
69 69
RAPI_URI_ENCODE_RE = re.compile("[^_a-z0-9]+", re.I)
70 70

  
71
RAPI_ACCESS_TEXT = {
72
  rapi.RAPI_ACCESS_WRITE: "write",
73
  rapi.RAPI_ACCESS_READ: "read",
74
  }
75

  
76
assert frozenset(RAPI_ACCESS_TEXT.keys()) == rapi.RAPI_ACCESS_ALL
77

  
78 71

  
79 72
class ReSTError(Exception):
80 73
  """Custom class for generating errors in Sphinx.
......
484 477

  
485 478
      access = rapi.baserlib.GetHandlerAccess(handler, method)
486 479

  
487
      perms = map(RAPI_ACCESS_TEXT.__getitem__, access)
488

  
489
      if not perms:
490
        perms.append("*everyone*")
480
      if access:
481
        perms = utils.CommaJoin(sorted(access))
482
      else:
483
        perms = "*everyone*"
491 484

  
492 485
      yield ("  | :ref:`%s <%s>`: %s" %
493
             (method, _MakeRapiResourceLink(method, uri),
494
              utils.CommaJoin(perms)))
486
             (method, _MakeRapiResourceLink(method, uri), perms))
495 487

  
496 488

  
497 489
class RapiAccessTable(s_compat.Directive):

Also available in: Unified diff