Skip to content

Hierarchy access (700)

Browse code 700 (BrowseCode::HierarchyAccess, “Rapportagestructuurtoegang”): which users and roles have access to which reporting structure, and with which access type. See Hierarchies for the reporting structures themselves.

Twinfield documentation: Browse data.

  • hie.xss.type is the access type: none, use, link or edit, and the only criterion.
  • A row has a user (hie.xss.user) or a role (hie.xss.role).
  • hie.xss.hierarchyhidden is true for a hidden reporting structure.

Criteria: access type. See browse-definitions/700.xml and the browse data guide.

All fields of the browse definition (browse-definitions/700.xml), with the label for a Dutch user, the data type and the values of a field with a fixed list (browsefields.xml). A field that is not visible is meant as criterion: asking for it as column can give a server error. Twinfield does not apply the proposed values: send every criterion you need.

Field Label Type Visible Criterion
fin.trs.head.office Administratie string yes
fin.trs.head.officename Adm.naam string yes
hie.xss.hierarchy Rapportagestructuur string yes
hie.xss.hierarchyname Rapportagestructuurnaam string yes
hie.xss.hierarchyhidden Verborgen special: false, true yes
hie.xss.role Rol string yes
hie.xss.rolename Rolnaam string yes
hie.xss.user Gebruiker string yes
hie.xss.username Gebruikersnaam string yes
hie.xss.type Toegangstype special: none, use, link, edit yes equal
$twinfield = Example::twinfield();
$type = $argv[1] ?? null;
$query = $twinfield->browse(BrowseCode::HierarchyAccess)
->columns(
'hie.xss.hierarchy',
'hie.xss.hierarchyname',
'hie.xss.hierarchyhidden',
'hie.xss.role',
'hie.xss.user',
'hie.xss.type',
);
if ($type !== null) {
$query = $query->equal('hie.xss.type', $type);
}
$result = $query->get();
echo count($result), ' access right(s)', $type === null ? '' : ' of type ' . $type, PHP_EOL;
foreach ($result as $index => $row) {
$user = $row->nullableString('hie.xss.user');
echo sprintf(
'[%d/%d] %s %s%s: %s %s',
$index + 1,
count($result),
$row->string('hie.xss.hierarchy'),
$row->nullableString('hie.xss.hierarchyname') ?? '',
$row->string('hie.xss.hierarchyhidden') === 'true' ? ' (hidden)' : '',
$user === null ? 'role ' . $row->string('hie.xss.role') : 'user ' . $user,
$row->string('hie.xss.type'),
), PHP_EOL;
}
Terminal window
php examples/browse-data/700-hierarchy-access/example.php # all access rights
php examples/browse-data/700-hierarchy-access/example.php edit # only who can edit

Add TWINFIELD_DEBUG=1 to see the SOAP requests and responses.

2 access right(s)
[1/2] RS01 Example reporting structure: user EXAMPLE edit
[2/2] RS01 Example reporting structure: role LVL1 edit

What the SDK sends to Twinfield and what Twinfield sends back, for a call like the one in this example. The responses come from the tests, with example data.

Twinfield documentation: Browse data: Compose the browse request and send it.

$twinfield->browse(BrowseCode::HierarchyAccess)
->columns(
'hie.xss.hierarchy',
'hie.xss.hierarchyname',
'hie.xss.hierarchyhidden',
'hie.xss.role',
'hie.xss.user',
'hie.xss.type',
)
->equal('hie.xss.type', 'edit')
->get();

The SDK sends this XML as xmlRequest of ProcessXmlString to processxml.asmx:

<columns code="700" optimize="true">
<column>
<field>hie.xss.hierarchy</field>
<visible>true</visible>
</column>
<column>
<field>hie.xss.hierarchyname</field>
<visible>true</visible>
</column>
<column>
<field>hie.xss.hierarchyhidden</field>
<visible>true</visible>
</column>
<column>
<field>hie.xss.role</field>
<visible>true</visible>
</column>
<column>
<field>hie.xss.user</field>
<visible>true</visible>
</column>
<column>
<field>hie.xss.type</field>
<visible>true</visible>
<operator>equal</operator>
<from>edit</from>
</column>
</columns>

Twinfield answers with this XML in ProcessXmlStringResult:

<browse result="1" first="1" last="2" total="2">
<th>
<td label="" hideforuser="false" type="String">hie.xss.hierarchy</td>
<td label="" hideforuser="false" type="String">hie.xss.hierarchyname</td>
<td label="" hideforuser="false" type="String">hie.xss.hierarchyhidden</td>
<td label="" hideforuser="false" type="String">hie.xss.role</td>
<td label="" hideforuser="false" type="String">hie.xss.user</td>
<td label="" hideforuser="false" type="String">hie.xss.type</td>
</th>
<tr>
<td>RS01</td>
<td>Example reporting structure</td>
<td name="Nee">false</td>
<td/>
<td>EXAMPLE</td>
<td name="Bewerken">edit</td>
<key>
<office>1000</office>
</key>
</tr>
<tr>
<td>RS01</td>
<td>Example reporting structure</td>
<td name="Nee">false</td>
<td>LVL1</td>
<td/>
<td name="Bewerken">edit</td>
<key>
<office>1000</office>
</key>
</tr>
</browse>

View examples/browse-data/700-hierarchy-access/example.php on GitHub.

Made by SolveBeam

Twinfield and Wolters Kluwer are trademarks of Wolters Kluwer. Their names and logos are used only to refer to their products.