Function "SetSubdomain()"

Top  Previous  Next

Sets a security sub domain property for the active user. Once a subdomain is set it remains the same during the user session or until another SetSubdomain() function is used.

Syntax:

SetSubdomain(subdomainname)

 

Parameters:

subdomainname

the name of the sub-domain.

 

Completion Codes:

0: Normal completion

12: Syntax error or Security Broker error

 

Example:

SetSubdomain(FIRM_ID)

 

Note:

The value set with this function will be available to the security brokers as the variable '@{subdomain}'. For instance if you are developing your own bsp file you can use it as follows:

 

  # Get User Info By Name

  {

    SELECT ID, FIRM_ID, NAME, EMAIL, FULLNAME, DISABLED

      from users WHERE FIRM_ID = @{subdomain} AND NAME = '@{username}'   
  }

 

 
By utilizing the subdomain property we can organize sub domains under the same security domain. This way the same user names can be used in different sub domains or each sub domain may have its own roles and checkpoints. If this is the case you want to implement then you should rearrange your Broker SQL Pattern file by using @{subdomain} broker variable efficiently.

 

See SML Functions