code: def permissions(self):
          
          perms = set(super(DocumentWorkflow, self).permissions())
          if g:
              if hasattr(g, 'permissions'):
                  perms.update(g.permissions or [])
              if hasattr(self.document, 'permissions'):
                  perms = self.document.permissions(current_auth.actor, perms)
          return perms
docs: Permissions for this workflow. Plays nice with
          :meth:`coaster.views.load_models` and
          :class:`coaster.sqlalchemy.PermissionMixin` to determine the available
          permissions to the current user.