I would like to check not only a users role, but also from which user source the currently logged in user is. The user should only be able to interact with a component when he comes from the right usersource and has the required roles.
I have found the expression hasRole(“Administrator”, [user]", [usersource]) and the python function system.security.getRoles() , but they do not solve my problem, since they only check for a users role, or the role of a user from a specific usersource. But I need to be able to know the current users usersource.
Unfortunately I don’t see how I can get this information. The documentation of hasRole() says that if left blank, the current users usersource is used. So I assume that this information should be available somewhere.
Security levels and zones would probably be best suited to handle this, but we are using Vision and they can not be used to restrict access to vision components, so i have to check it in a script.