Jump to content

Controlling who can use button , or limiting a script run based on security.


mpg
 Share

This topic is 5677 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies

Hi Everyone.. I have a question. I have inherited a FM Pro 4 (Win) database that has a script that is run from a button. I want to limit the people / groups from using and running this script or from hitting the button, because it is an administrator function. My question is... how to prevent or limit user from being able to run a script or using the button? I would appreciate any help you could provide.

Mike.

Link to comment
Share on other sites

You can test with the Status(CurrentGroups) function. Realize that it returns all the groups a password belongs to in a return-separated list so you need to use the PatternCount function for the test:

PatternCount(Status(CurrentGroups); "GroupName")

This will return a 0 or 1 or a false or true that will allow an IF script step to determine whether they can run the script or not.

I usually take it a step further to make sure the group you are looking for is the one you actually locate. For example, imagine this simplified list of Groups returned by the Status(CurrentGroups) function:

10¶

20

The "¶" character is a return but won't really display when you look at the result of a calculation. The point is, what if I am looking for group "2". It will be located in the list above even though it doesn't really exist. Here is a better formula:

PatternCount("¶" & Status(CurrentGroups) & "¶"; "¶GroupName¶")

In the formula, you actually type the "¶" character which you will see a button for in the calculation dialog. If you are now searching for "¶2¶" in the example above, it won't be located.

Link to comment
Share on other sites

This topic is 5677 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.