VPA Restrictions Entered in the Archibus Roles Table

You specify VPAs per-role, that is, in the Archibus Roles table. There are a number of options to VPAs that are summarized below.

The use of these options will become clearer when you view the examples in these "how to" topics:

Archibus Role VPA Restriction Format

When specifying a restriction in the VPA Restriction field of the Archibus Roles table you use an XML format.

The VPA has three forms:

The following examples describe how to work with these VPA restrictions:

sqlRestriction VPA

Syntax

<restriction type="sql" sql="strWhereClause">
 <title translatable="true">strTitle</title>
 <field table="strTable"/>
</restriction>

Parameters

title. This is an optional description of the restriction, such as "Restrict to Archibus User Table’s Building List."

table. The table name for the VPA.

sql. The restriction for the VPA.

Example

<restriction type = "sql" sql =
"eq.site_id IN (#ASQL_GetAfmUserCachedValue('vpa_option1' ))
OR
eq.bl_id IN (#ASQL_GetAfmUserCachedValue( 'vpa_option2' ))))">
<title translatable="true">
  "Restrict Equipment to Site or Building List"</title>
<field table="eq" />
</restriction>

Usage

sqlRestrictionForValidatedTables VPA

Syntax

<restriction type="forValidatedTables" sql="strWhereClause ">  <title translatable="true"> strTitle </title>  <validatingTable name="site"/></restriction>

Parameters

validatingTable. The table name for the VPA. The program will apply this VPA to:

Example

<restriction type="forValidatedTables" sql="#ASQL_VPAField()LIKE 'HQ%'OR #ASQL_VPAField()LIKE 'JFK%'" >   <title translatable="true"> </title> <validatingTable name="bl"/> </restriction>

Usage

For sqlRestrictionForValidatedTables, the restriction SQL statement contains the entire set of clause or clauses; however, instead of the tablename qualifier and field name, the statement uses the #ASQL_VPAField() macro.

The program will expand this macro at runtime based on each table and field name it is applying the VPA macro to.

sqlRestrictionForFieldsNamed VPA

Syntax

<restriction type="forFields" sql="strWhereClause">
  <title translatable="true">strTitle</title> <field name="strTable"/>
</restriction>

Parameters

field. The field name for the VPA. The program will apply this VPA to all fields named identically. For instance, a VPA on field tc_service would match ca.tc_service and eq.tc_service but not a (hypothetical) field named eq.tc_service_one.

Example

#ASQL_VPAField() = 'V'"> /  <title translatable="true">Restrict access to Voice Service</title> <field name="rc_service"/> </restriction>

Usage

For sqlRestrictionForFieldsNamed, the restriction SQL statement contains the entire set of clause or clauses; however, instead of the tablename qualifier and field name, the statement uses the #ASQL_VPAField() macro.

The program will expand this macro at runtime based on each table and field name it is applying the VPA macro to (based on an exact match of the field name).

Multiple Restrictions

<restrictions>
<restriction type="forFields"
sql="#ASQL_VPAField() NOT IN (#ASQL_GetAfmUserCachedValue('vpa_option1'))">
<title translatable="true">Fields-Named Restriction on bl_id</title>
<field name="bl_id"/>
</restriction>
<restriction
type="forFields"
sql="#ASQL_VPAField() NOT IN (#ASQL_GetAfmUserCachedValue('vpa_option2'))">
<title translatable="true">Fields-Named Restriction on site_id</title>
<field name="site_id"/>
</restriction>
</restrictions>