Difference between revisions of "InRole"
From SmartWiki
Line 21: | Line 21: | ||
<font color="red">'''Wrong''':</font> @me.inRole(''rolename1'' OR ''rolename2'')@ | <font color="red">'''Wrong''':</font> @me.inRole(''rolename1'' OR ''rolename2'')@ | ||
+ | |||
+ | {| | ||
+ | |'''Correct''': | ||
+ | |'''@me.inRole(Organization Contact)@''' | ||
+ | |- | ||
+ | |<font color="red">'''Wrong''':</font> | ||
+ | |"@owner.inRole(Organization Contact)@" | ||
+ | |- | ||
+ | |<font color="red">'''Wrong''':</font> | ||
+ | |@me.inRole("Organization Contact")@ | ||
+ | |- | ||
+ | |<font color="red">'''Wrong''':</font> | ||
+ | |"@me.inRole("Organization Contact")@" | ||
+ | |- | ||
+ | |<font color="red">'''Wrong''':</font> | ||
+ | |@me.InRole(Organization Contact)@ OR @me.inrole(Organization Contact)@ | ||
+ | |- | ||
+ | |<font color="red">'''Wrong''':</font> | ||
+ | |@me.inRole(''rolename1'' OR ''rolename2'')@ | ||
+ | |} | ||
+ | |||
''For multiple role names use: @me.inRole(''rolename1'')@ OR @me.inRole(''rolename2'')@ | ''For multiple role names use: @me.inRole(''rolename1'')@ OR @me.inRole(''rolename2'')@ |
Revision as of 07:12, 27 June 2013
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 – Watch for 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 – This is looping the role names in the instance and tries to match what is in the brackets. Use the exact role name without encapsulating.
Correct: @me.inRole(Organization Contact)@
Wrong: "@owner.inRole(Organization Contact)@"
Wrong: @me.inRole("Organization Contact")@
Wrong: "@me.inRole("Organization Contact")@"
Wrong: @me.InRole(Organization Contact)@ OR @me.inrole(Organization Contact)@
Wrong: @me.inRole(rolename1 OR rolename2)@
Correct: | @me.inRole(Organization Contact)@ |
Wrong: | "@owner.inRole(Organization Contact)@" |
Wrong: | @me.inRole("Organization Contact")@ |
Wrong: | "@me.inRole("Organization Contact")@" |
Wrong: | @me.InRole(Organization Contact)@ OR @me.inrole(Organization Contact)@ |
Wrong: | @me.inRole(rolename1 OR rolename2)@ |
For multiple role names use: @me.inRole(rolename1)@ OR @me.inRole(rolename2)@