I would expect the background color to change depending on whether
When I replace hasRole("Administrator") with "True" or "False" then all good
This when running in client
Are you sure that your Administrator role actually is spelled that way, and that your logged in user has the Administrator role? Throw in an extra label and connect it to "[System]Client/User/RolesString" to be sure.
Ah my bad. Clearly my morning coffee was not strong enough, sorry about that.
In the case of Perspective, I guess I would just benefit from the "session.props.auth.user.roles" property to see if the "Administrator" role is in that value.
In the backgroundColor binding I would retrieve the "session.props.auth.user.roles" property, and e.g. use a script transform something like:
if "Administrator" in value:
return "#00FF00"
else:
return "#FF0000"
Have not tested the hasRole expression in Perspective.
The message says there is a "Configuration_Error"
If I mis-typed role as ""Fred Nurk Role", sureli I should get Boolean False, not "Configuration_Error"
I'm pretty sure in Perspective, you should be using isAuthorized, rather than hasRole, because all Perspective authentication is relative to security levels, rather than 'classic' user source roles.
Returns true if the user has the given role. The username and usersource parameters are optional in the client scope, but required in the Gateway scope.
They are required in Gateway scope, perspective runs in gateway scope.