- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Temporaril y users rights.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-26-2012 11:37 AM
I need to temporarily set a Users rights to an Administrative role in a VB script. Any input would be appreciated. Thanks.
Re: Temporaril y users rights.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-27-2012 06:17 AM
Are you talking about MAS rights or rights on the PC? If you're talking about MAS, then it's probably better/easier to create a dummy account that can do whatever you need it to do. If you are talking about the PC, then you need to look at the "runas" command, which allows you to run a program as an administrator with full admin rights. You can elevate an individual users rights, but that user would have to log out and log back in for those rights to take effect, which is probably not practical in a script.
Hope that helps.
SGS Technology Group
Our Blog
If you don't like change, you're going to like irrelevance even less.
Re: Temporaril y users rights.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-27-2012 08:20 AM
Here is my problem. I've created a vb script to edit the GL number on the sales order lines which is a combination of the customer division, warehouse, and a UDF order type. It is triggered after the item number is entered. It works fine if you have the rights to General Ledger Maintance. It gives an error 88 without the rights. Can't let sales people have these rights.
I tried using the code from SY_Security but I can't seem to make it work:
' create security object for security event checking
coSecurity = NEW("SY_Security", coSession, taskID, 1)
' pass in the user/password to validate and check rights
rights=coSecurity'CheckOverrideOptPassword(Adminis
Re: Temporaril y users rights.
[ Edited ]
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-27-2012 01:33 PM - last edited on 01-27-2012 02:07 PM
In my test, I (my role) don't have any rights to G/L Account Maintenance. I have G/L Module Option 'Allow Automatic Creation of Accounts' checked. G/L setup option 'Auto Create when all Segments are Valid' is Yes.
In my SO_SalesOrderDetail, ItemCode PostValidate script, I set SalesAcctKey$ to a not-on-file account number. All segments in this account are valid. It creates this G/L account.
retVal = 0
retVal = oBusObj.SetValue("SalesAcctKey$", "111-60-04", "kACCOUNT")
(I assume that you want to make new G/L account.)
Sr. Software Engineer
Sage 100 ERP


