cancel
Showing results for 
Search instead for 
Did you mean: 

UI API company object GetFormLicenseStatus

edy_simon
Active Contributor
0 Kudos

Hi,

Referring to this post https://community.sap.com/t5/enterprise-resource-planning-q-a/check-user-permission-on-form-type-for...
The original post was on 2007,
I need to use this method to check for current user form permission for my own form (NOT system form).
But I always get a 'Full' license.

var license = SBO_Application.Company.GetFormLicenseStatus("MyFormType");


Even when passing a non-existent formtype, it still returns FULL.
Anyone knows how to use this method correctly?

Regards
Edy

Accepted Solutions (1)

Accepted Solutions (1)

edy_simon
Active Contributor
0 Kudos

Hi,
I thought I leave my workaround here for others who may need.

  1. Use the Users object to iterate the UserPermission object. This should returns the permission as specified in authorization.
  2. In case the Users object throw exception due to no access rights, means current user is not granted the "Disable DI API Permission Check". Thus the Sbob.GetSystemPermission method should return the correct permission.

Thank you.

Answers (2)

Answers (2)

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Dear edy_simon,

If you want to get the correct permission, you need to set "Disable DI API Permission Check" with "No authorization" for the login user.

Kindly refer to SAP Note 2108119 for the steps and more details.

  1. If you set "Disable DI API Permission Check" = "No Authorization" means all permissions set for the user applies in the SAP Business Client.
  2. If it is set to Full Authorization, then all permission gets "Read/Write" that is equivalent to "Full Authorization" in SAP Business One Client.

Kind regards,

ANKIT CHAUHAN

SAP Business One Support

edy_simon
Active Contributor
0 Kudos

Hi Ankit,
Thank you. I fully understand the logic behind the Disable DI API Permission Check.
Maybe i should re-phrase my question.

When a user is given Disable DI API Permission check, is there anyway to check the base permission?
Ie. Permission for 'Permission A' is No Authorization.
When we use the GetSystemPermission, it will return 'FULL'  this is expected.
Is there anyway we can get the 'No Authorization' as set on the screen.

Regards
Edy

 

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Dear edy_simon,

Refer to SAP Note 1756928 for the same.

Kind regards,

ANKIT CHAUHAN

SAP Business One Support

edy_simon
Active Contributor
0 Kudos
Hi Ankit,
edy_simon
Active Contributor
0 Kudos

Hi Ankit,
The solution in the notes will always return a "FULL" if the user is granted 'Disable DI API permission check'
I believe this is to check the permission of using this object in DI API.
The solution i need is to check the UI access permission.
Any other way?

Regards
Edy