User.reject - Python API

Changes a user's approval_status to 'rejected'. A rejected user may not log in until he or she is approved. It is not an error to reject an already rejected user.

Only super-users may approve or reject other users.

self.sso.user.reject_user

reject_user(self, cid, user_id, current_ust, current_app, remote_addr)

  • cid: Correlation ID used by audit log
  • user_id: ID of the user to approve
  • current_ust: Current user's UST - must belong to a super-user
  • current_app: Name of application the current user is issuing the call from
  • remote_addr: User's remote address
  • Returns: (None)
# -*- coding: utf-8 -*-

# Zato
from zato.server.service import Service

class RejectUser(Service):
    def handle(self):

        # Request metadata
        current_ust = 'gAAAAABanYYUAaBcsIn6OKhpW9ia6CdflCG7AE_m7...'
        current_app = 'CRM'
        remote_addr = '127.0.0.1'

        # User to approve
        user_id = 'zusrzw764rvcr84vtcb3ctyha5cbe'

        self.sso.user.approve_user(self.cid, data, current_ust, current_app, remote_addr)