Share via


roles Element

Defines roles.

Type

  xsd:complexType

Child Elements

Element Description
role Defines role.
membership Maps a user or group of users to a role.

Attributes

Attribute Type Required Description Possible Values
default
  xsd:string
Yes Specifies the name identifier of the role that is the default role. string
  xsd:string
initiator
  xsd:string
No Specifies the name identifier of the role chosen to be the initiator role. string
  xsd:string
hideStatusBarDisplay
  xdYesNo
No Specifies whether the current role should be displayed in the status bar.
  • yes
  • no
  xdYesNo

Definition

  <xsd:element name="roles">
  <xsd:complexType>
    <xsd:sequence>
      <xsd:element ref="xsf:role" minOccurs="1" maxOccurs="unbounded"/>
      <xsd:element ref="xsf:membership" minOccurs="0" maxOccurs="1"/>
    </xsd:sequence>
    <xsd:attribute name="default" type="xsd:string" use="required"></xsd:attribute>
    <xsd:attribute name="initiator" type="xsd:string" use="optional"></xsd:attribute>
    <xsd:attribute name="hideStatusBarDisplay" type="xsf:xdYesNo" use="optional"></xsd:attribute>
  </xsd:complexType>
  <!-- role names must be unique -->
  <xsd:unique name="roles_name_unique">
    <xsd:selector xpath="./xsf:role" />
    <xsd:field xpath="@name" />
  </xsd:unique>
  <!-- fields must reference existing role -->
  <xsd:key name="role_name_key">
    <xsd:selector xpath="./xsf:role" />
    <xsd:field xpath="@name" />
  </xsd:key>
  <xsd:keyref name="role_default" refer="xsf:role_name_key">
    <xsd:selector xpath="." />
    <xsd:field xpath="@default" />
  </xsd:keyref>
  <xsd:keyref name="role_initiator" refer="xsf:role_name_key">
    <xsd:selector xpath="." />
    <xsd:field xpath="@initiator" />
  </xsd:keyref>
  <xsd:keyref name="role_membership" refer="xsf:role_name_key">
    <xsd:selector xpath="./xsf:membership/*" />
    <xsd:field xpath="@memberOf" />
  </xsd:keyref>
</xsd:element>

Remarks

Note   If this element or attribute is in the form definition file (.xsf), InfoPath Forms Services will prevent the form template from being deployed to the server as a browser-compatible form.

Example

The following is an example of the roles element:

  <xsf:roles initiator="A" default="C" hideStatusBarDisplay="yes">
   <xsf:role name="A"/>
   <xsf:role name="B"/>
   <xsf:role name="C"/>

<xsf:membership> <xsf:getUserNameFromData dataObject="catalog" select="/dfs:myFields/dfs:dataFields/d:UserA" memberOf="B"/> <xsf:userName name="Domain\username1" memberOf="A" /> <xsf:userName name="Domain\username2" memberOf="B" /> <xsf:group name="Domain\username3" memberOf="C" /> </xsf:membership> </xsf:roles>