src/wcmf/lib/security/impl/AbstractPermissionManager.php
protected function serializePermissions($permissions) {
    $result = $permissions['default'] === true ? PermissionManager::PERMISSION_MODIFIER_ALLOW.'* ' :
        PermissionManager::PERMISSION_MODIFIER_DENY.'* ';
    if (isset($permissions['allow'])) {
      foreach ($permissions['allow'] as $role) {
        $result .= PermissionManager::PERMISSION_MODIFIER_ALLOW.$role.' ';
      }
    }
    if (isset($permissions['deny'])) {
      foreach ($permissions['deny'] as $role) {
        $result .= PermissionManager::PERMISSION_MODIFIER_DENY.$role.' ';
      }
    }
    return trim($result);
  }
protected function serializePermissions($permissions) {
    $result = $permissions['default'] === true ? PermissionManager::PERMISSION_MODIFIER_ALLOW.'* ' :
        PermissionManager::PERMISSION_MODIFIER_DENY.'* ';
    if (isset($permissions['allow'])) {
      foreach ($permissions['allow'] as $role) {
        $result .= PermissionManager::PERMISSION_MODIFIER_ALLOW.$role.' ';
      }
    }
    if (isset($permissions['deny'])) {
      foreach ($permissions['deny'] as $role) {
        $result .= PermissionManager::PERMISSION_MODIFIER_DENY.$role.' ';
      }
    }
    return trim($result);
  }
protected function serializePermissions ( $ permissions ) { $ result = $ permissions [ 'default' ] === true ? PermissionManager :: PERMISSION_MODIFIER_ALLOW . '* ' : PermissionManager :: PERMISSION_MODIFIER_DENY . '* ' ; if ( isset ( $ permissions [ 'allow' ] ) ) { foreach ( $ permissions [ 'allow' ] as $ role ) { $ result .= PermissionManager :: PERMISSION_MODIFIER_ALLOW . $ role . ' ' ; } } if ( isset ( $ permissions [ 'deny' ] ) ) { foreach ( $ permissions [ 'deny' ] as $ role ) { $ result .= PermissionManager :: PERMISSION_MODIFIER_DENY . $ role . ' ' ; } } return trim ( $ result ) ; }
Convert an associative permissions array with keys 'default', 'allow', 'deny'
into a string.
@param $permissions Associative array with keys 'default', 'allow', 'deny',
where 'allow', 'deny' are arrays itself holding roles and 'default' is a
boolean value derived from the wildcard policy (+* or -*).
@return A role string (+*, +administrators, -guest, entries without '+' or '-'
prefix default to allow rules).
Convert an associative permissions array with keys default allow deny into a string .