Difference between revisions of "InRole"

From SmartWiki
Jump to: navigation, search
Line 5: Line 5:
 
There are three things to use caution about this syntax:
 
There are three things to use caution about this syntax:
  
*'''Case Sensitive''' – Watch for lower case “i” and upper case “R”
+
*'''Case Sensitive''' – The syntax must be '''inRole''' exactly: lower case “i” and upper case “R”
 
*'''Do not encapsulate the whole syntax''' – This syntax always returns a value, either true or false which mostly would not cause any problems for example in [[sslogic]] or visibility conditions. However, encapsulation of the syntax will return a string which is useless if not equaled to another string.   
 
*'''Do not encapsulate the whole syntax''' – This syntax always returns a value, either true or false which mostly would not cause any problems for example in [[sslogic]] or visibility conditions. However, encapsulation of the syntax will return a string which is useless if not equaled to another string.   
 
*'''Do not encapsulate the role name''' –  Use the exact role name without quotes.
 
*'''Do not encapsulate the role name''' –  Use the exact role name without quotes.

Revision as of 18:11, 18 January 2014

This syntax can be used on Submit Logic, Advanced Logic, visibility conditions, browser scripts or any other role-specific validation. It will always return a value, either true or false.

@object.inRole(Rolename)@

There are three things to use caution about this syntax:

  • Case Sensitive – The syntax must be inRole exactly: lower case “i” and upper case “R”
  • Do not encapsulate the whole syntax – This syntax always returns a value, either true or false which mostly would not cause any problems for example in sslogic or visibility conditions. However, encapsulation of the syntax will return a string which is useless if not equaled to another string.
  • Do not encapsulate the role name – Use the exact role name without quotes.
Correct: @me.inRole(Organization Contact)@
Wrong: "@owner.inRole(Organization Contact)@" - don't put quotes around the variable. It's a true/false value, not a string.
Wrong: @me.inRole("Organization Contact")@ - don't put quotes around the role name. The role name is Organization Contact, not quote Organization Contact unquote.
Wrong: "@me.inRole("Organization Contact")@" - don't put quotes around both things...
Wrong: @me.InRole(Organization Contact)@ OR @me.inrole(Organization Contact)@ - use the correct capitalization, inRole
Wrong: @me.inRole(rolename1 OR rolename2)@ - instead of this, use @me.inRole(rolename1)@ OR @me.inRole(rolename2)@

See Also