cancel
Showing results for 
Search instead for 
Did you mean: 

Authorization Settings for AddOns

Former Member
0 Kudos

Hi,

I need to control the visible menu items of my addon in dependency of the active user.

eg.:

Admin - All menu Items

User - All Items without administration buttons

or sth. like that.

How can I realize it?!

Greetz, Sebastian

Accepted Solutions (0)

Answers (1)

Answers (1)

barend_morkel2
Active Contributor
0 Kudos

Hi Sebastian,

You can access the current logged on user using DI API.

(Do a Single Sign on to the SBO client, create the Company object with the context cookie)

Use the Company object's .username to get the active user. You can then user the SAPbobsCOM.Users object to allow you to check the user's status (the ".Superuser" property is probably what you're llokin for)

Former Member
0 Kudos

Hi Sebastian,

You can also use APPLICATION object in UI API to get current user information. In your add-on code, use

m_oApplication.Company.UserName

to get user's name, then check the user's privilige with USER object in DI API.

Best Regards,

Nicky He

Trinidad
Product and Topic Expert
Product and Topic Expert
0 Kudos

You will also need to create different autorizations for each one of the options you want to diferentiate.

For that you need to use the DI object UserPermissionsTree. Please have a look to it on the DI help file. You have also a sample called Permissions inside the DI samples, 06.Permissions.

After you have defined your permissionsTree you will asign the different permissions to each one of the users.

Hope it helps

Trinidad.

Former Member
0 Kudos

where can i find those samples?

FOA
Advisor
Advisor
0 Kudos

Hi Itay,

After you installed the SDK Development version. All samples will be installed under C:\Program Files\SAP Manage\SAP Business One SDK\Samples.

In the specific case of Permissions, you will find it in:

C:\Program Files\SAP\SAP Business One SDK\Samples\COM DI\VB.NET\06.Permissions

Best regards,

Felipe