You can use the javascript HasRights function defined in SharePoints core.js , you just need to pass the lower (limit) permission mask, as well as the upper limit.
See the post on Checking permissions with Javascript in Sharepoint 2007 and a list of permission masks . Since you want to check if this is an administrator, you can try the ManageWeb permission ManageWeb : 0x0000000040000000
Edit: Another possibility does not use the
HasRights function, and
SPSecurityTrimmedControl simply sets the global Javascript variable. An example you can find here:
SharePoint: Run JavaScript based on user rights / permissions . This, of course, means extra markup (and does not work in the content editor web part), but it does work.
source share