We wanted to do something similar. We have the website locked down to only members of a certain group. However even with that, there are a few people that we didn't want to have access to view their screen or anything that could pose a security risk of some info (seeing something we aren't supposed to see).
As such, we created 2 columns in the ' tsysactions ' table called 'secure' and 'domain'. The secure (bit) is what tells us if that action is a secure action or an action that anyone can use. Domain (nvarchar(1)) lists a simple letter to describe whether that action is ok for all domains or a specific domain (we have specific actions for some domains)
Once that was setup, we altered the actions aspx page to include 2 variables to pass through to the stored procedure 'web30actions' to find out the computer name and domain of the screen. Once that was done, it was just adding if statements to the stored procedure to filter out what we needed. An example of our new stored procedure...
ALTER PROCEDURE [dbo].[Web30Actions](@comp varchar(300), @domain varchar(80))
AS
/* Default setting */
if @comp = 'it_laptop'
begin
SELECT Description, Action, Icon, confirmation
FROM dbo.tsysactions
WHERE (enabled = 1)
ORDER BY sortorder
end
/* Begin Secure Actions */
else if @comp = 'accounting_main'
begin
SELECT Description, Action, Icon, confirmation
FROM dbo.tsysactions
WHERE (secure = 0) and (enabled = 1) and (domain = 'F') or
(secure = 0) and (enabled = 1) and (domain = 'A') or
(secure = 0) and (enabled = 1) and (domain = 'W')
ORDER BY sortorder
end
/* Linux VNC only */
else if @comp like 'Linux%'
begin
SELECT Description, Action, Icon, confirmation
FROM dbo.tsysactions
WHERE (enabled = 1) and (domain = 'L')
ORDER BY sortorder
end
else
/* Everything else */
begin
SELECT Description, Action, Icon, confirmation
FROM dbo.tsysactions
WHERE (enabled = 1)
ORDER BY sortorder
end
What this shows is basically keeping the original procedure at the top for our it_laptop computer. For our accounting computer, we only show actions that have secure = true, enabled = true, and domain = f (main domain) or secure = false, enabled = true, and domain = a (all) or secure = false, enabled = true, and domain = w (windows). We also have a few linux machines that we sometimes need to remote into so we created a specific action for that to do the VNC with a different port number than standard. So with that one we check for the domain = l (linux) and enabled = true. Which for us is only the one action. The last one is everything else which is the same as the first one just to make sure we don't get rid of it yet we have a good starting point for the if statement.
Might not be exactly what you want to do but it's a different approach if you wanted to make things a bit more secure.