.. Warning: this file is automatically generated. Edits will be lost .. list-table:: Functions defined in :mod:`MNAuthorization` :widths: 3 3 10 10 30 :header-rows: 1 * - Tier - Version - REST - Function - Parameters * - Tier 2 - 1.0 - ``GET /isAuthorized/{id}?action={action}`` - :func:`isAuthorized` - (:class:`session`, :class:`id`, :class:`action`) ``->`` boolean .. function:: isAuthorized(session,id,action) -> boolean Test if the user identified by the provided session has authorization for operation on the specified object. A successful operation is indicated by a return HTTP status of 200. Failure is indicated by an exception such as :exc:`NotAuthorized` being returned. The body of the response is arbitrary and SHOULD be ignored by the caller. If the action is not authorized, then a :exc:`NotAuthorized` exception MUST be raised. .. Note:: Should perhaps add convenience methods for "canRead()" and "canWrite()" to verify that a user is able to read / write an object. :Version: 1.0 :Use Cases: :doc:`UC01 `, :doc:`UC37 ` :REST URL: ``GET /isAuthorized/{id}?action={action}`` :param session: Session information that contains the identity of the calling user as retrieved from the X.509 certificate which must be traceable to the CILogon service. The subject of the session defaults to the :term:`public user` if the certificate was not provided with the request. Transmitted as part of the SSL handshake process. :type session: :class:`Types.Session` :param id: The identifer of the resource for which access is being checked. May be either a PID or a SID. Will use the HEAD PID when given a SID value. Transmitted as part of the URL path and must be escaped accordingly. :type id: :class:`Types.Identifier` :param action: The type of operation which is being requested for the given pid. Transmitted as a URL query parameter, and so must be escaped accordingly. :type action: :class:`Types.Permission` :returns: True if the operation is allowed :rtype: boolean :raises Exceptions.ServiceFailure: ``(errorCode=500, detailCode=1760)`` :raises Exceptions.NotImplemented: ``(errorCode=501, detailCode=1780)`` :raises Exceptions.NotFound: ``(errorCode=404, detailCode=1800)`` :raises Exceptions.NotAuthorized: ``(errorCode=401, detailCode=1820)`` This error is raised if the request comes from a black listed source (e.g. a temporary block may be imposed on a source that calls this method too many times within some time interval) :raises Exceptions.InvalidToken: ``(errorCode=401, detailCode=1840)`` :raises Exceptions.InvalidRequest: ``(errorCode=400, detailCode=1761)``