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:
When specifying a restriction in the VPA Restriction field of the ARCHIBUS Roles table you use an XML format.
The VPA has three forms:
sql
specific to a particular table.
This is used when:ForValidatedTables
template for a restriction
that can be expanded for all tables with a given name or that hold fields
that validate on the table with the given name. This is the most common
form of VPA restriction.ForFields
template for a restriction
that can be expanded for all fields with a given name. This is typically
used for "generic" restrictions on non-validated fields, such
as the tc_service enumeration field. <restrictions>
tag.The following topics describe how to work with these VPA restrictions:
<restriction type="sql"
sql="strWhereClause">
<title translatable="true">strTitle</title>
<field table="strTable"/>
</restriction>
title. This is an optional description of the restriction (e.g. "Restrict to ARCHIBUS User Table’s Building List."
table. The table name for the VPA.
sql. The restriction for the VPA.
<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>
sqlRestrictions
, the
restriction SQL statement contains the entire set of clause or clauses
including the tablename qualifier and field names (e.g. "bl.bl_id
LIKE ‘HQ%’").sqlRestrictions
, the sql can include compound conditions
(e.g. "bl.bl_id = ‘HQ’ or bl.bl_id=’WARE’).sqlRestrictions
never need
to use the #ASQL_VPAField()
(and cannot use this macro), since the field
name is specified in the restriction (rather than being generated by the
program when it applies a generic VPA to all relevant fields).<restriction type="forValidatedTables"
sql="strWhereClause ">
<title translatable="true"> strTitle </title>
<validatingTable name="site"/>
</restriction>
validatingTable. The table name for the VPA. The program will apply this VPA to:
<restriction type="forValidatedTables"
sql="
#ASQL_VPAField()
LIKE ‘HQ%’OR
#ASQL_VPAField()
LIKE ‘JFK%’" >
<title translatable="true"> </title>
<validatingTable name="bl"/>
</restriction>
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.
<restriction type="forFields"
sql="strWhereClause">
<title translatable="true">strTitle</title>
<field name="strTable"/>
</restriction>
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.
<restriction type="forFields"
sql= "
#ASQL_VPAField()
= ‘V’">
<title translatable="true">Restrict access to Voice
Service</title>
<field name="rc_service"/>
</restriction>
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).
<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>
Copyright © 1984-2014, ARCHIBUS, Inc. All rights reserved. |