1255
Views
18
Comments
You don't have permission to view this screen

In Patient self service portal, after creating doctor appointment list, I am getting an error in browser  that you don't have permissions to view this screen , please contact your system administrator. 


Followed all steps from lesson material pdf carefully and checked twice but not able to find the mistake.


screen error.png
UserImage.jpg
Saurabh Shivananda Prabhu Chimulkar

Hi Dheer,

In Outsystems application, this page is shown when you are authenticated in the app but don't have the required authorization to view the target screen. 

Please check on which Screen you were getting redirected to that threw a security exception that resulted in you getting an invalid permission page. On that Screen, under the Role section ensure that you have the required Roles checked and your User should be associated with the Role.

As you know, you can assign Role to the User from the built-in Users application.

If you have verified everything and still facing the issue, then logout and login again just to be sure that the latest user permissions are in effect.

Every Module by default has a Global Exception Handler -> Common/OnException. In this handler, there is a Security Exception Handler which will redirect User to Invalid Permission page if User is authenticated and Security exception thrown, else it redirects to the Login page.

Hope this helps.

Regards,

Saurabh


2022-09-24 10-18-41
Dheer Singh

hello @Saurabh Prabhu Chimulkar sir,

i had tried everything, but unable to find the root of the problem .

please help me out by checking my file , so that I can complete it and move forward

patientportalapp0.oml
UserImage.jpg
Badar Nasir


Hi Dheer, I run into same issue as well. So I started looking into it. The important thing you need to remember that Out Systems uses Chrome browser. This browser stores the login details of your all of the accounts you use to log into any part of Out Systems (Service centres users module, Life Time etc.). Now e.g. if you logged in to any of the part with an account say admin account, then chrome places this account on the top of the Out Systems browsing data. So now when you run your app then even though you are logged on to service studio with your development account and your development account does have permission on the screen "But" chrome will use the credential for the last logon account to other part (as explained few lines above). Since that last account does not have the screen permission so you will be directed to error screen. Phew long explanation, I hope you got it. Now comes the solution. I deleted the out systems data as explained below.

Firstly click on 3 dots on the top left hand corner of chrome -> then from the menu select settings -> Then select privacy and security -> site setting -> View Permission and data stored across sites -> Then delete Out Systems data from the list.

Once you delete the cookie data then run the app from service studio. This time Chrome will use your developer account that will have the permission on the screen and you should be able to see the app screen. Let me know if this resolves your issue or if I am wrong. Mark this as solution if this resolves your issue.

2016-04-22 00-29-45
Nuno Reis
 
MVP

Hello Dheer.

I recently did that exercise and agree it is not clear on that step.

The page you want is for doctors only, you've done it right.

But probably you are still logged in as the patient. You have to logout and log in as Ann Devon.

If you log as a doctor, you will be sent to the Appointments page.


This should be written on the steps to be take

2022-09-24 10-18-41
Dheer Singh

hii @Nuno Reis 

No no , I logged out from my account and logged in from doctor Ann Devon's credentials.

but still it is not working , should I go ahead by ignoring this or I have to solve this error first.

ann .png
2016-04-22 00-29-45
Nuno Reis
 
MVP

I installed your oml and it worked (well, I had to remove the signaturepad and removeaccents references).

Do a debug with a breakpoint on Login's switch (image above) to see where it failed.

2022-09-24 10-18-41
Dheer Singh

Done everything but not getting up the root cause ( still screen is not visible for the doctor)


@Yashraj Nayak sir please look out into this and help me out


2024-07-16 17-36-51
Shradha Rawlani

Hi Dheer,

Assign the roles to users from user portal

Regards

Shradha

UserImage.jpg
Adhitya Rahman

Hi Dheer, 

on Common Screen double-click onException icon, then in securityException in if iGetUserId()<>NullIndetifier swap to true to server action User_getUnifiedLoginUrl.


registration-form-notallowed.png
2022-09-24 10-18-41
Dheer Singh

@Adhitya Rahman  after doing this, not able to login from doctor id and the screen gets refreshed again on the login page


earlier at least doctor is able to login 

2021-12-23 04-28-09
Navneet Sharma

Hello @Dheer Singh ,

Here is complete solutions 

Please find the OML file and look into the OML code VS your code. 

I hope this will help you 


Thanks & Regards

Navneet Sharma


DoctorAppointmentSystem.oml
UserImage.jpg
Arunava Mukherjee

Hi Navneet, 

I downloaded your OML. Did you fix the error by removing the doctor completely from the application? You don't have doctor role, screens or portal at all. What was the fix?

By the way, the problem still persists. 

UserImage.jpg
Arunava Mukherjee

In case anyone is stuck in the same error - the issue is with the Role_CheckDoctor function. You can find it in Logic > Client Actions > Roles.

Open the function' and double-click on the JS step - you will see the following:

$parameters.IsDoctor = $public.Security.checkIfCurrentUserHasRole($roles.PortalAdmin);

The correct parameter is:

$parameters.IsDoctor = $public.Security.checkIfCurrentUserHasRole($roles.Doctor);

It was probably just a copy/paste issue. Once you fix that, the permission check executes correctly.

UserImage.jpg
Shaira Micah Nogoy

this works for me! thanks!!!

UserImage.jpg
LIN FEIYAN

this works for me too! thank you very much!!!   Y(^v^)Y

UserImage.jpg
Badar Nasir

Hi Dheer, I run into same issue as well. So I started looking into it. The important thing you need to remember that Out Systems uses Chrome browser. This browser stores the login details of your all of the accounts you use to log into any part of Out Systems (Service centres users module, Life Time etc.). Now e.g. if you logged in to any of the part with an account say admin account, then chrome places this account on the top of the Out Systems browsing data. So now when you run your app then even though you are logged on to service studio with your development account and your development account does have permission on the screen "But" chrome will use the credential for the last logon account to other part (as explained few lines above). Since that last account does not have the screen permission so you will be directed to error screen. Phew long explanation, I hope you got it. Now comes the solution. I deleted the out systems data as explained below.

Firstly click on 3 dots on the top left hand corner of chrome -> then from the menu select settings -> Then select privacy and security -> site setting -> View Permission and data stored across sites -> Then delete Out Systems data from the list.

Once you delete the cookie data then run the app from service studio. This time Chrome will use your developer account that will have the permission on the screen and you should be able to see the app screen. Let me know if this resolves your issue or if I am wrong. Mark this as solution if this resolves your issue.

UserImage.jpg
João Cruz

I had the same error and managed to solve it. 

Basically, I downloaded the .OAP project from the tutorial several times over. This did not occur with other people I know who did the project from the first .OAP project and never redownloaded from further steps in the tutorial.

What happened is that whenever I added a new .OAP project, the database would add new users to the already existing ones, which meant that in the end I had repeated users, Ann Devon being one of them. 

If this is happening to you, check the Users entity inside 'Entities -> Database -> (System)' in the Data tab of your module and filter with 'User.Name like "Ann D%"'.

If there are multiple Ann Devons, then you need to delete all except the one with the highest Id number. Follow this tutorial to delete all repeats, by using the query 'DELETE FROM {Users} WHERE {User}.[Name] LIKE 'Ann D%' AND {User}.[Id] <> XX', where 'XX' should be swapped by the Ann Devon user Id number that is the highest.

2023-06-17 02-52-37
Ria Andriana

I also had the same error and thankfully found the answer posted by João Cruz. It's the same issue because I was installing the .oap file two times, and creating two Ann Devons in my User entity.
As mentioned you can check in Data > Entities > Database > (System) > User and filter it with User.Name = "Ann Devon"

However if this is the case for you, you can also delete this by using SQL Sandbox, you can install it from Forge and open it in browser. 
In the main page, find 'User' and click it, and then type the SQL 'DELETE FROM {User} WHERE {User}.[Id] = xx' in the input field. There will be a prompt saying that this is dangerous and may ruin your career, so click on it if you are really sure that it needs to be deleted :)


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.