altair Posted May 6, 2008 Posted May 6, 2008 Hi All, I disabled some of my scripts using Accounts & Privileges. Scripts are attached to a button, when ever i click the button a message pops up. My question is, how can i disable the error message? I tried putting Set Error Capture[on] to the script but error message still pops up. Thanks all.
Fenton Posted May 6, 2008 Posted May 6, 2008 By removing access to the script in Accounts & Privileges (A&P) you removed access to the script (yeah -). So you can't test anything within the script nor suppress the message, you don't have access to even start the script. What you can do is create another script to run that script, which they do have access to, and do your tests first, before calling the original script as a subscript (using the Perform Script step). Of course by that time it doesn't much matter anymore whether you've turned off access in A&P. Turning off access to scripts in A&P is a great feature for scripts that are (were) visible in the Scripts menu, as it removes them from visibility as well. But it's not so great for buttons, unless you need that extra level of security, as you can just put the tests for access within the script itself instead. Be aware that scripts with the option checked (lower left), [x] Run with Full Access, with have a privilege set of "Full Access", defeating tests for privileges within the script.
altair Posted May 6, 2008 Author Posted May 6, 2008 Hi Fenton, I followed your suggestion and it worked fine here's sample of the script. Question again, what if I have to add another privilege? Get(PrivilegeSetName)="201" what is the syntax for adding condition Ex. ="201" "Accounting" etc... Thanks again Fenton for the reply
Steven H. Blackwell Posted May 7, 2008 Posted May 7, 2008 Be aware that scripts with the option checked (lower left), [x] Run with Full Access, with have a privilege set of "Full Access", defeating tests for privileges within the script. Actually not. You just have to call the Privilege Set information before the script fires, usually by attaching a parameter to the calling object that returns: Get(PrivilegeSetName) Pass that parameter to the script and you can then perform the test. HTH Steven
Fenton Posted May 7, 2008 Posted May 7, 2008 Yes, Steven's right (of course -). I wasn't meaning to say that there were not ways to avoid getting caught out by [x] Full Access, I was just warning about it (and being too lazy to say how to get around it). The Script Parameter is a good one (I'll remember that), if it's button driven, or called by another script. If it's a menu driven script, you can capture the privilege set in a "wrapper" script before calling the Full Access script. As far as adding another test, you just add it, like in any other calculation. If [ Get ( PrivilegeSetName ) = "donuts" or Get ( PrivilegeSetName ) = "coffee" ] There is also the "negative" version of the above: If [ Get ( PrivilegeSetName ) ≠ "Admin" and Get ( PrivilegeSetName ) ≠ "Manager" ] Notice the negative one uses "and". I have found that it's often better in the long run to test against the "higher" level privilege sets, than it is to test against the "lower" level ones. Because the higher ones are often fewer and change less often. [P.S. I highly recommend a text tool like TextExpander or Spell Catcher, to type those long function names for you :-]
altair Posted May 7, 2008 Author Posted May 7, 2008 Thanks for the reply, hope you don't get tired of helping us less fortunate..hehe Thanks again u 2
Steven H. Blackwell Posted May 7, 2008 Posted May 7, 2008 Not to worry, Fenton. If I am right on somethng, it's usually because I have been wrong before on the same thing...often more than once. >) Many thanks for all your contributions to this Forum. Steven
Recommended Posts
This topic is 6042 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 accountSign in
Already have an account? Sign in here.
Sign In Now