You are here

function pmpapi_permissions_fetch_permissions in Public Media Platform API Integration 7

Fetches permissions for a given PMP doc.

$guid string The GUID of the doc.

Return value

object The permissions of the PMP doc.

1 call to pmpapi_permissions_fetch_permissions()
pmpapi_permissions_attach_perm_elements in pmpapi_permissions/pmpapi_permissions.module
Attaches any applicable permission elements to a given (entity CRUD) form.

File

pmpapi_permissions/pmpapi_permissions.module, line 330

Code

function pmpapi_permissions_fetch_permissions($guid) {
  $permissions = db_query('SELECT permissions FROM {pmpapi_local_docs} WHERE guid=:guid', array(
    ':guid' => $guid,
  ))
    ->fetchField();
  if (!empty($permissions)) {
    return unserialize($permissions);
  }
}