case_get_associate_permissions ( session, case, associate )

case_get_associate_permissions ( session, case, associate )

Returns the list of permissions that a CASE has granted to an ASSOCIATE. This operation is restricted by privileges granted to the session's user. It is only allowed if:

  • The CASE corresponds to the same session's user
  • The session's user is an ASSOCIATE of 'case' and has the permission #PERMISSION.ASSOCIATE_MANAGE
  • The session's user is a professional (doctor)

Input

parameters:

  • session: is the token obtained in the session_init call
  • case
  • associate

Output

parameters:

  • Result: an XML with permissions
    • permissions: List of permissions that can be granted to the associate
      • permission
        • code: code of the permission. This is the value that must be used to change the access type granted to an associate when invokingĀ case_set_associate_permissions ( session , case, associate, permissions )
        • description: Description of the permission in the active session language
        • access_options: Introduced in API Version 2.7.25. List of available access types that can be assigned to the permission. For example, some permissions can have access type 'edit' or 'browse', while in other permissions only the 'browse' access type can be set.
        • access_type: Granted access type. Possible values that can be assigned to this property are enumerated in the access_options field
  • ErrorMsg: any fault in the call, either in the validation of input parameters, errors in the connection to the database or any other error, this parameter returns the error message produced

Request

sample:

case_get_associate_permissions("LC00000:000000", 3424, 2543)

Response

sample:

<?xml version="1.0" encoding="UTF-8"?>
<result>
   <permissions>
      <active>true</active>
      <use_default>false</use_default>
      <editable>true</editable>
      <permission>
         <code>MEDICAL_PROFILE_BROWSE</code>
         <description>Can browse my medical profile</description>
         <access_type>browse</access_type>
         <access_options>browse</access_options>
      </permission>
      <permission>
         <code>ASSOCIATE_MANAGE</code>
         <description>Can manage my associates</description>
         <access_type>edit</access_type>
         <access_options>browse,edit</access_options>
      </permission>
   </permissions>
</result>
<ErrorMsg></ErrorMsg>

Notes:

Each permission can be customised for a particular associates, but there is also the possibility of using the CASE default permissions.

When using the default permissions (see "use_default" field in function response), the list of permissions included in the function response still has the customised values, but the server will not use them unless "use_default = true"