on 10-04-2007 9:05 AM
I have a user defined object which has a UserPermission. I have Full/ReadOnly/None authorisation for its associated form. This works fine but the is also a higher level function that updates all records in the table by importing data from an external source. I have created a child authorisation and made it an Item. How do check whether the current user has this authoristion in my Add-On?
I did not require to change the Permission just get the value.
The following code shows how I got the value:
Dim oCompany as SAPbobsCOM.Company
Dim oSBObob As SAPbobsCOM.SBObob
Dim oPermission As SAPbobsCOM.Recordset
Dim PermissionValue as Integer
oSBObob = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoBridge)
oPermission = Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
oPermission = oSBObob.GetSystemPermission(oCompany.UserName, "PermissionID")
PermissionValue = oPermission.Fields.Item(0).Value
'The PermissionValue variable can then be checked against the BoPermission Enumeration
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Robert,
Have you tried to use the UserPermission property in the Users object (DI API)?
oUser.UserPermission.PermissionID = txtPermissionID.Text
oUser.UserPermission.Permission = SAPbobsCOM.BoPermission.boper_Full
retVal = oUser.Update()
Hope it helps
Trinidad.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
102 | |
12 | |
11 | |
6 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.