73
Views
8
Comments
Solved
How to restrict a user while another user is accessing the screen

Hello,

In an application which we have developed, we have multiple users. I am trying to restrict a user while another user of the same role is accessing the screen.

I have found something in forum, that is ScreenInUse as boolean. Is it added in a screen or client variables?

Please help me out with this.

2022-09-12 05-19-11
Apoorv Choubey
Solution

Hi @Vinay Kumar Gande 

As per my understanding here is my solution for that problem you can do that.

  • Create one entity with userid and screenname/screen identifier and flag.
  • when user A access that particular screen made a entry with userid and screenid and also change flag for that screen.
  • When user B trying to access that screen check that screen engage with other user or not at the same time.
  • And you can delete that entry on leaving screen OnDestroy event of the screen or change screen URL.
  • Also create one timer that delete that record if accidentally you close the browser or any network issue occur.
2025-02-10 17-24-13
Arun Rajput

Hi @Vinay Kumar Gande 

You want that if two users logged in same application but if first user is doing something on Home screen (for Ex) then 2nd user could not access Home screen.

Is I understood correct?

Best

Arun 

UserImage.jpg
Vinay Kumar Gande

Hello, 

No, we have multiple users for same the same role and they use the application. The employees will perform experiments on daily bases. So, If one of the employee starts performing the experiment, After the 1st step, in the list screen a ExpNo will be visible. So, If other employee wants to open that experiment, how to restrict with ScreenInUse.

2022-05-02 13-50-49
Paulo Ritto

Hi @Vinay Kumar Gande ,

I have a suggestion for you:

Is the Experiment concept stored in DB? If yes, why not add a attribute to the Experiment table, called CreatedBy (of type User Identifier, or Employee Identifier for your case), then if other users try to open the ExpNo screen, you check if the GetUserId() = Experiment.CreatedBy. Only if this condition is fulfilled, you allow the user to go into the screen.


Let me know what you think of this,

Paulo

UserImage.jpg
Vinay Kumar Gande

Hello,

But we have to allow the other users as well for the same screen so that they will be able to perform operations and will need to enter the data as well.

2022-09-12 05-19-11
Apoorv Choubey
Solution

Hi @Vinay Kumar Gande 

As per my understanding here is my solution for that problem you can do that.

  • Create one entity with userid and screenname/screen identifier and flag.
  • when user A access that particular screen made a entry with userid and screenid and also change flag for that screen.
  • When user B trying to access that screen check that screen engage with other user or not at the same time.
  • And you can delete that entry on leaving screen OnDestroy event of the screen or change screen URL.
  • Also create one timer that delete that record if accidentally you close the browser or any network issue occur.
2023-09-06 07-26-35
Sudip Pal

Hey Vinay,

Tell me one thing if a user logged in using his/her cred then if he/she close the browser without logged out then will it be blocked by another user?


Thanks & Regards,

Sudip Pal

UserImage.jpg
Vinay Kumar Gande

Hello Sudip,

Actually, we have a session time out for every user for 20 mins. So after the time limit, if they are not using the application they will be logged out automatically. Then the other users can be able to login and access the screen if necessary.

Thanks & Regards,

Vinay

2021-06-01 05-56-33
Komal Kumbhar

Hi Vinay,

To work this out, 

1. Create client action.

2. In this action find out the role of Logged in user and update the Client variable Role="Role of logged in User" .

3. When another user logged in, then find out its role and check it with client variable (Role) in which the role of already logged in User is stored before and also check the user name whether it's same user 

4. If role matched and user name mismatched then logout otherwise end.

3. Use this action in Login action. 


So every time user with same role kicked out.

Hope this helps,

Komal

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