I want to restrict users from logging into portal through role

Dinh Nguyen
Kilo Sage

Hello,

I did like below :

1. Navigate to Script include -> Search script with the name  "SPEntryPage ".

2. Open the script in detail, Find the function "getFirstPageURL".

3. Add role "itil" into user.hasRoles();

DinhNguyen_0-1680461411162.png

4. Go to sys_properties.list -> create new property

glide.entry.first.page.script
type: string
value: new SPEntryPage().getFirstPageURL(); 

DinhNguyen_1-1680461460577.png

 

My expect result : Only user with role 'itil' can login into Service Portal

But the result is : user without role 'itil' still can login into Service Portal

Where did I go wrong or missing? 

Please help me ! Thank you so much

 

1 ACCEPTED SOLUTION

Anks26
Kilo Sage

Hi Dinh,

This might not work because the condition you are looking at, is to make users with a specific role to go to the platform UI by default. Also, one of the problem in your code is on line 83, user.hasRoles('itil') will always come true, you need to replace it with user.hasRole('itil'). 

Please review below articles. 

Thanks

Anks




View solution in original post

2 REPLIES 2

Anks26
Kilo Sage

Hi Dinh,

This might not work because the condition you are looking at, is to make users with a specific role to go to the platform UI by default. Also, one of the problem in your code is on line 83, user.hasRoles('itil') will always come true, you need to replace it with user.hasRole('itil'). 

Please review below articles. 

Thanks

Anks




Thank you @Anks26