You are here

function eck_author_property_permissions in Entity Construction Kit (ECK) 7.3

Augmenting the permission system with own permissions.

1 string reference to 'eck_author_property_permissions'
author.inc in plugins/property_behavior/author.inc

File

plugins/property_behavior/author.inc, line 38

Code

function eck_author_property_permissions($property, $vars) {
  $op = $vars['op'];
  $perms = $vars['permissions'];
  $account = $vars['account'];
  $entity = $vars['entity'];
  $allow = FALSE;
  foreach ($perms as $perm) {
    $p = $perm->permission;
    $property = $entity->{$property};
    $uid = $account->uid;
    if (strcmp($p, "{$op} own entity") == 0 && $property == $uid) {
      $allow = TRUE;
    }
  }
  return $allow;
}