Is it possible to temporarily apply admin or last logged in user rights in order to close forms?


Author
Message
Cory Cookson
Cory Cookson
StrataFrame Novice (112 reputation)StrataFrame Novice (112 reputation)StrataFrame Novice (112 reputation)StrataFrame Novice (112 reputation)StrataFrame Novice (112 reputation)StrataFrame Novice (112 reputation)StrataFrame Novice (112 reputation)StrataFrame Novice (112 reputation)StrataFrame Novice (112 reputation)
Group: Forum Members
Posts: 30, Visits: 416
Scenario:

1) User 1 logs in with admin rights and opens up form1

2) Lock Screen happens due to timeout or pushing F11

3) User 2 logs in with lower rights than User 1

4) Here I want to close form1 so that User 2 has a fresh start with no open screens.

Question:

Is there a way to temporarily provide admin or the last users rights so that open forms can be closed programatically and then return to using User 2's rights?

Cory Cookson

Software Developer

Occupational Health Research

Replies
Cory Cookson
Cory Cookson
StrataFrame Novice (112 reputation)StrataFrame Novice (112 reputation)StrataFrame Novice (112 reputation)StrataFrame Novice (112 reputation)StrataFrame Novice (112 reputation)StrataFrame Novice (112 reputation)StrataFrame Novice (112 reputation)StrataFrame Novice (112 reputation)StrataFrame Novice (112 reputation)
Group: Forum Members
Posts: 30, Visits: 416
I have gotten this far in the AfterSessionLock event:

SFSUsersBO sfs = new SFSUsersBO();

sfs.FillByUserName(_LastUserLoggedIn);

SecurityBasics.CurrentUser = MicroFour.StrataFrame.Security.LoggedInUser.CreateNew(sfs);

This gives me back the user who had previously logged in but the form I want to close is still disabled and will not close w00t

As always all feed back is appreciated.



Cory Cookson

Software Developer

Occupational Health Research

Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
I'd look into a custom login form. Then you could set a flag that the session timed out (before session timed out event), then test for that when the user logs back in...they'll use your login form to do it, so you could test there if the user is changing after a time out and handle the forms before logging the new user in.



This also suggests an enhancement request: CurrentUserChanging event, which might be cancelable.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Cory Cookson - 17 Years Ago
Ivan George Borges - 17 Years Ago
Trent L. Taylor - 17 Years Ago
Cory Cookson - 17 Years Ago
Cory Cookson - 17 Years Ago
Greg McGuffey - 17 Years Ago
Cory Cookson - 17 Years Ago
Ivan George Borges - 17 Years Ago
Cory Cookson - 17 Years Ago
Ivan George Borges - 17 Years Ago
Cory Cookson - 17 Years Ago
Cory Cookson - 17 Years Ago
     bump
Cory Cookson - 17 Years Ago
Ivan George Borges - 17 Years Ago
Dustin Taylor - 17 Years Ago
Cory Cookson - 17 Years Ago
Cory Cookson - 17 Years Ago
             Great, Cory! :cool:
Ivan George Borges - 17 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search