Jump to content

RE: Accounts & Privileges


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

Recommended Posts

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.

Picture3.png

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Hi Fenton,

I followed your suggestion and it worked fine here's sample of the script.

Picture3-1.png

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 :-]

Link to comment
Share on other sites

This topic is 5855 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
×
×
  • Create New...

Important Information

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