Thus far, the primary means of securing components in Perspective is through session properties. Under
auth there are the
user.roles properties, which give you insight into the user’s privileges (provided you’re using roles/security zones and are requiring the user to log in, otherwise these properties are null-valued).
You can then set bindings as needed on components you wish to lock down. For example, to secure a Numeric Entry component, you could place a binding on it’s
props.enabled property to disable it if the user doesn’t have a certain role/zone. Alternatively, if you don’t even want unauthorized users to see a component, you can set its
meta.visible property to false with the same logic.
Here’s an example of a binding that you can Copy and Right-Click+“Paste Binding” onto the
enabled property of, say, a Numeric Entry Field in your designer. Note that designer sessions have null-valued
auth properties, so I alternatively allow designers access to the Numeric Entry box for debugging purposes (which you may or may not find useful).
"code": "\t# str() cast here so there\u0027s no freak-out over \u0027null\u0027 auth.user.roles prop in designer\n\tif \"Administrator\" in str(value) or self.session.props.device.type \u003d\u003d \"designer\":\n\t\treturn True\n\telse:\n\t\treturn False",