cancel
Showing results for 
Search instead for 
Did you mean: 

Menu Added by XML and user permission

Former Member
0 Kudos

Hello,

I've created an add-on and it adds several user menu using an XML file.

My problem is that some of the menu should not be added because the user does not have permission.

How can I make that the menu added are only the menu the user can open ?

Whith Business One, a user without permission starts with altmost no menu.

Also when I make modification on the main form using form setting, and I want the user menu not to be visible, the information is not saved, and then when I open again Business One, the user menu are still there

Please help me.

Accepted Solutions (1)

Accepted Solutions (1)

AdKerremans
Active Contributor
0 Kudos

Hello Patrick,

If you add menus using XML it is not possible to to any permission checking. If you and permission checking while the menu is added, you should add it in code or remove the menu afterwards.

I have never tested the second part of your question.

Regards,

Ad

Former Member
0 Kudos

Thank you for your answer

but my problem is that I have a lot of menus.

I can't use VB code to add them because it's too long.

How SDN people are doing it ?

Former Member
0 Kudos

You can create the XML dynamically (depending on what the may see), and use this string to create your menus.

Former Member
0 Kudos

Another aproach could be:

If the forms shown when the menus are clicked are user forms, set the authorization in the form level (As SAP does). And this way, when you set the configuration to "Apply authorization" only the allowed menus should appear.

Have a look at John Mackin´s presentation in the San Francisco TechSummit, for an example.

Hope helps,

Ibai Peñ

Former Member
0 Kudos

Thank you, but I have no link beween the menu, and the authorization (maybe that's why SAP doesn't give the functionalities)

so it's difficult to create the dynamic string.

Maybe I can have it by adding a usertable, that gives the link be authorization and the menu, but I was hoping that SAP do it.

Thank you

Message was edited by: Patrick Rolland

Former Member
0 Kudos

Hi Patrick,

With the trick I explain you don´t need any of the stuff you say. The only requeriment is that the forms are user forms, not standard B1 forms.

Have a look <a href="https://websmp205.sap-ag.de/~form/sapnet?_FRAME=OBJECT&_HIER_KEY=701100035871000454604&_SCENARIO=011">here</a> at the file named 120805_BestPractices_Danober-c.pdf where it is explained. It will worth, I think

Regards,

Ibai Peñ

Former Member
0 Kudos

Thank you Ibai for the link, it was very interesting.

But if I'm right, in the presentation, John speaks about the permission on the form, how to set them using the form type.

But it's not about the menu. The menu remain present even if the form type (permission) is set to "No authorization" . I think this is due to the fact that you have no link between the menuUID, and the permissionUID in Business One.

To open a form, you first catch the MenuEvent, so the add-on create the link between a menuUID, and a form. Then the application check the form type.

Thank you

Answers (0)