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.
Hi @Vinay Kumar Gande
As per my understanding here is my solution for that problem you can do that.
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
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.
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
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.
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
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.
Vinay
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