Re: Login window
Re: Login window
- Subject: Re: Login window
- From: Chris Page <email@hidden>
- Date: Thu, 23 Jul 2009 22:59:39 -0700
On Jul 23, 2009, at 3:39 AM, Emmanuel LEVY wrote:
I wonder if you could insert a "neutral" shell command which you
would require to authentify, such as:
try
do shell script "ls /" with administrator privileges
-- authentication OK
on error
-- authentication failed
end
Note that this has little security value. If the goal is to require
the user to authenticate for a right that your script requires for its
own purposes*, you may want to use "do shell script" to invoke the
"security authorize" command. You would either choose a predefined
right or define one of your own in the authorization database (which
requires admin privilege to modify). See the man page for the
"security" command for more information. This gives you control over
which users are allowed to acquire a given right, offering much finer
control than "can you authenticate as an admin user".
* That is, you want to verify that the user can authorize a right that
your script uses to decide whether or not to perform some action. In
contrast, if there are any commands the script wishes to perform which
themselves require some sort of authorization, either those commands
should already be prompting the user themselves or you should use "do
shell script ... with administrator privileges" to run privileged
commands. You can even use that to run osascript to run an AppleScript
with administrator privileges.
--
Chris Page
The other, other AppleScript Chris
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden