def GrantApproval(self, requestor_username, approval_id, grantor_username):
    """Grants approval for a given request using given username."""
    try:
      approval = self.approvals_by_username[requestor_username][approval_id]
      approval.grants.append(
          rdf_objects.ApprovalGrant(
              grantor_username=grantor_username,
              timestamp=rdfvalue.RDFDatetime.Now()))
    except KeyError:
      raise db.UnknownApprovalRequestError("Can't find approval with id: %s" %
                                           approval_id)
def GrantApproval ( self , requestor_username , approval_id , grantor_username ) : try : approval = self . approvals_by_username [ requestor_username ] [ approval_id ] approval . grants . append ( rdf_objects . ApprovalGrant ( grantor_username = grantor_username , timestamp = rdfvalue . RDFDatetime . Now ( ) ) ) except KeyError : raise db . UnknownApprovalRequestError ( "Can't find approval with id: %s" % approval_id )
Grants approval for a given request using given username.