Dynamic View Permissions

Has anyone found a way to make view permissions dynamic?

We have some pages that we want restricted to specific users if a tag is set to True. At the moment I’ve been locking down all the buttons and nav menu, but obviously the user could just type the address into the URL

What about having this on an onStartup event of the root container?

if system.tag.readBlocking(["[default]permissionTag"])[0].value:
	self.meta.visible = system.perspective.isAuthorized(False, "Authenticated/Roles/Administrator")
	self.meta.visible = True

May be a good idea having it stored as a tag, I’m wondering though, if an admin logs out and doesn’t navigate away would the page still be accessible, or does the logging out reactivate the startup script.

I’ll need to do some testing