cancel
Showing results for 
Search instead for 
Did you mean: 

Trying to make Kickstart App not appear when not being Admin

chrisx_212
Champ in-the-making
Champ in-the-making
Hello all.

I'd like to know how to make sure that when I log in as a user without admin capabilities, they will not see the Kickstart App default menu in the main landing page. I've tried including this function in the Kickstart App definitions:

isVisible: function(){   return AuthenticationSharedService.hasAdminCapability();}‍‍‍


Within the runtime-app-definition.js but it gives out a NULL value. When said line was given in, for example, idm-app.js, it will give out a proper true/false depending on Admin Capabilities (so the menus User and Organization do not appear in the Identity Management header menu), so it works properly there.

Where can we put on the 'check if user has Admin Capabilities or not' for this endeavor? I suspect somewhere like landing-app.js, but I'm not sure. Help?

Thank you.
3 REPLIES 3

jbarrez
Star Contributor
Star Contributor
This is from the top of my head … but doesn't the 'account' call returns the information on which capabilities the user has?

duddex
Champ in-the-making
Champ in-the-making
I changed the if-statement in runtime-app-definition-service.js from
<javascript>
if (app.defaultAppId === 'kickstart') {
  …
}
</javascript>
to
<javascript>
if (app.defaultAppId === 'kickstart' && AuthenticationSharedService.hasAdminCapability()) {
  …
}
</javascript>

Now I don't see the Kickstart button as a normal user (means <code>AuthenticationSharedService.hasAdminCapability()</code> is not null for me and contains the correct value).

But it is still possible to access the editor when you enter the URL directly (http://localhost:8080/activiti-app/editor/). I will take a closer look and I will post an update as soon as I found out more details about this.

walkhadher
Champ in-the-making
Champ in-the-making
you must use the hasAdminCapability() in the all begin of the all  kickstart's views controller if 's return null value then use  $scope.backToLanding() this method  exist  in all kickstart controllers