What determines if the user has privileges? If it's just full access, then you can check the box at the bottom of the Edit Script window. You can restrict user via user privileges in File>Manage>Security.
And you can look at some of the Get functions....Get(AccountName), Get(AccountPrivilegeSetName), Get(UserName)
I Have set a Privilege Set USER in the Data Access Design under Records I set with custom privileges ( Create Record) is set to No. but when I try to create a record using button with the script above I can create a record.
That should only be possible if your script is set to "run with full access privileges" or you are actually logged in with a different account and privilege set.
Thanks Phil for pointing me to the right direction. That little tick is the culprit