﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » Role Based Security  » Is it possible to temporarily apply admin or last logged in user rights in order to close forms?</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Wed, 08 Apr 2026 00:43:13 GMT</lastBuildDate><ttl>20</ttl><item><title>Is it possible to temporarily apply admin or last logged in user rights in order to close forms?</title><link>http://forum.strataframe.net/FindPost20813.aspx</link><description>Scenario:&lt;/P&gt;&lt;P&gt;1) User 1 logs in with admin rights and opens up form1&lt;/P&gt;&lt;P&gt;2) Lock Screen happens due to timeout or pushing F11&lt;/P&gt;&lt;P&gt;3) User 2 logs in with lower rights than User 1&lt;/P&gt;&lt;P&gt;4) Here I want to close form1 so that User 2 has a fresh start with no open screens.&lt;/P&gt;&lt;P&gt;Question:&lt;/P&gt;&lt;P&gt;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?</description><pubDate>Tue, 25 Nov 2008 11:05:55 GMT</pubDate><dc:creator>Cory Cookson</dc:creator></item><item><title>RE: Is it possible to temporarily apply admin or last logged in user rights in order to close forms?</title><link>http://forum.strataframe.net/FindPost20897.aspx</link><description>Great, Cory! :cool:</description><pubDate>Tue, 25 Nov 2008 11:05:55 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item><item><title>RE: Is it possible to temporarily apply admin or last logged in user rights in order to close forms?</title><link>http://forum.strataframe.net/FindPost20895.aspx</link><description>I believe that I've found a solution to the issue.&amp;nbsp; Code snippets as follows:&lt;/P&gt;&lt;P&gt;[codesnippet]&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;&lt;P&gt;public&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;static&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;void&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; HandleCurrentUserChanged(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;object&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; sender, &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;EventArgs&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt; e)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;if&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; (_UserID.Length &amp;gt; 0)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;_UserChanged = (_UserID != &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;SecurityBasics&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;.CurrentUser.UserName.ToString());&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;_UserID = &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;SecurityBasics&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;.CurrentUser.UserName.ToString();&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;if&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;(_UserChanged)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;for&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; (&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;int&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; i = 0; i &amp;lt;= &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;Application&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;.OpenForms.Count - 1; i++)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;MicroFour.StrataFrame.UI.Windows.Forms.&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;BaseForm&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; bf = (MicroFour.StrataFrame.UI.Windows.Forms.&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;BaseForm&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;)&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;Application&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;.OpenForms[i];&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;if&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; (bf.Name != &lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;FONT color=#a31515 size=2&gt;"Form1"&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;)&lt;/P&gt;&lt;P&gt;bf.Close();&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;private&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;static&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;void&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; HandleBeforeSessionLock(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;object&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; sender, &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;EventArgs&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; e)&lt;/P&gt;&lt;P&gt;{&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;&lt;FONT color=#008000 size=2&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;for&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; (&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;int&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; i = 0; i &amp;lt;= &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;Application&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;.OpenForms.Count - 1; i++)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;MicroFour.StrataFrame.UI.Windows.Forms.&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;BaseForm&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; bf = (MicroFour.StrataFrame.UI.Windows.Forms.&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;BaseForm&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;)&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;Application&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;.OpenForms[i];&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;if&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; (bf.Name != &lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;FONT color=#a31515 size=2&gt;"Form1"&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;if&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; (bf.EditingState == MicroFour.StrataFrame.Business.&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;BusinessEditingState&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;.Editing)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;if&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; (MicroFour.StrataFrame.Messaging.&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;MessageForm&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;.ShowMessage(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;FONT color=#a31515 size=2&gt;"unsaved data detected"&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;,&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;FONT color=#a31515 size=2&gt;"Do you want to save your changes to "&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; + bf.Name, &lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;FONT color=#a31515 size=2&gt;""&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;, MicroFour.StrataFrame.Messaging.&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;MessageFunction&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;.YesNo, MicroFour.StrataFrame.Messaging.&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;MessagingIcon&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;.Question,&lt;/P&gt;&lt;P&gt;MicroFour.StrataFrame.Messaging.&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;MessagingSounds&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;.DefaultSound) == MicroFour.StrataFrame.Messaging.&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;MessageFunctionType&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;.Yes)&lt;/P&gt;&lt;P&gt;bf.Save();&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;else&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;bf.Undo();&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/FONT&gt;&lt;P&gt;[/codesnippet]</description><pubDate>Tue, 25 Nov 2008 10:30:06 GMT</pubDate><dc:creator>Cory Cookson</dc:creator></item><item><title>RE: Is it possible to temporarily apply admin or last logged in user rights in order to close forms?</title><link>http://forum.strataframe.net/FindPost20879.aspx</link><description>Thank you for the replies!&amp;nbsp; I really appreciate the support of the forum.&lt;/P&gt;&lt;P&gt;I am making sure that the first user has saved or reloaded all data that they are working on before they are logged out.&lt;/P&gt;&lt;P&gt;I've tried recalling LockSession in the afterSessionLock event and it just brings up the login form again.&lt;/P&gt;&lt;P&gt;I want to close the open forms without the second user even knowing they were open.&amp;nbsp; &lt;/P&gt;&lt;P&gt;There are however times that another person will login with equivelant rights and they should be able to see all of the screens that were left open by the first user.&lt;/P&gt;&lt;P&gt;As always any help is appreciated :)</description><pubDate>Mon, 24 Nov 2008 14:54:38 GMT</pubDate><dc:creator>Cory Cookson</dc:creator></item><item><title>RE: Is it possible to temporarily apply admin or last logged in user rights in order to close forms?</title><link>http://forum.strataframe.net/FindPost20869.aspx</link><description>Once you change the user you will have to call LockSession again to refresh the form states. You'll have to account for this in your AfterSessionLock logic, however,&amp;nbsp;to prevent it from getting into an infinite loop. &lt;/P&gt;&lt;P&gt;That said, this isn't what I would recommend to handle the issue of unclosable locked forms. The session locking works the way it does for a reason, namely that users lower privileges should &lt;EM&gt;&lt;STRONG&gt;not&lt;/STRONG&gt;&lt;/EM&gt; be able to tamper with the work done by users of higher privileges (including discarding changes made by the administrator). That is why they have the different levels, to prevent one from having access to the other.&amp;nbsp; As such, if you want to avoid the situation where an administrator logs out, and then a standard users logs in and can't close some open forms, I would recommend enforcing the administrator to save and close their work before logging out, rather than upping the permissions of the standard user to allow them access to explicitly denied forms or functions.</description><pubDate>Mon, 24 Nov 2008 09:56:03 GMT</pubDate><dc:creator>Dustin Taylor</dc:creator></item><item><title>RE: Is it possible to temporarily apply admin or last logged in user rights in order to close forms?</title><link>http://forum.strataframe.net/FindPost20861.aspx</link><description>Hi Cory.&lt;/P&gt;&lt;P&gt;Have you also tried Greg's advice, and worked on your Login form? Since we are fighting the normal behavior of the SessionLock, working on your Login form could give you some flexibility to take care of actions.</description><pubDate>Mon, 24 Nov 2008 05:53:32 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item><item><title>RE: Is it possible to temporarily apply admin or last logged in user rights in order to close forms?</title><link>http://forum.strataframe.net/FindPost20859.aspx</link><description>bump</description><pubDate>Sun, 23 Nov 2008 21:03:34 GMT</pubDate><dc:creator>Cory Cookson</dc:creator></item><item><title>RE: Is it possible to temporarily apply admin or last logged in user rights in order to close forms?</title><link>http://forum.strataframe.net/FindPost20846.aspx</link><description>yes I've tried it but it doesn't seem to reset the security on the forms so that they are no longer disabled.</description><pubDate>Fri, 21 Nov 2008 16:02:05 GMT</pubDate><dc:creator>Cory Cookson</dc:creator></item><item><title>RE: Is it possible to temporarily apply admin or last logged in user rights in order to close forms?</title><link>http://forum.strataframe.net/FindPost20845.aspx</link><description>yes it doesn't seem to affect the fact that the form has already been disabled.</description><pubDate>Fri, 21 Nov 2008 16:00:40 GMT</pubDate><dc:creator>Cory Cookson</dc:creator></item><item><title>RE: Is it possible to temporarily apply admin or last logged in user rights in order to close forms?</title><link>http://forum.strataframe.net/FindPost20832.aspx</link><description>OK. Now, in the AfterSessionLock, before dealing with your open forms, have you tried something like:&lt;/P&gt;&lt;FONT size=2&gt;&lt;P&gt;Login.SetLoggedInUser(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;FONT color=#a31515 size=2&gt;"YourAdminUser"&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;, &lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;FONT color=#a31515 size=2&gt;"YourAdminPassword"&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;, &lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;FONT color=#a31515 size=2&gt;""&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;&amp;nbsp;&lt;/P&gt;&lt;/FONT&gt;</description><pubDate>Fri, 21 Nov 2008 12:34:14 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item><item><title>RE: Is it possible to temporarily apply admin or last logged in user rights in order to close forms?</title><link>http://forum.strataframe.net/FindPost20831.aspx</link><description>yes, in the beforesessionlock I make sure that any form that has unsaved changes gets taken care of so that in the afterSessionLock event all that should have to happen is I close the&amp;nbsp;open forms&amp;nbsp;if it is not the same user.</description><pubDate>Fri, 21 Nov 2008 12:06:44 GMT</pubDate><dc:creator>Cory Cookson</dc:creator></item><item><title>RE: Is it possible to temporarily apply admin or last logged in user rights in order to close forms?</title><link>http://forum.strataframe.net/FindPost20824.aspx</link><description>Hi.&lt;/P&gt;&lt;P&gt;I see you worked your code in the AfterSessionLock. Have you tried managing your users in the BeforeSessionLock too?</description><pubDate>Fri, 21 Nov 2008 09:46:30 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item><item><title>RE: Is it possible to temporarily apply admin or last logged in user rights in order to close forms?</title><link>http://forum.strataframe.net/FindPost20821.aspx</link><description>This doesn't make sense to me.&amp;nbsp; I'm able to switch users on the fly and&amp;nbsp;the particular user I am swapping to&amp;nbsp;does show as admin.&lt;/P&gt;&lt;P&gt;Is there a way at this point to tell security to reload so that the forms are not disabled?&lt;/P&gt;&lt;P&gt;It just feels like I'm missing something simple here (or not explaining myself well enough) :hehe:</description><pubDate>Fri, 21 Nov 2008 07:07:38 GMT</pubDate><dc:creator>Cory Cookson</dc:creator></item><item><title>RE: Is it possible to temporarily apply admin or last logged in user rights in order to close forms?</title><link>http://forum.strataframe.net/FindPost20820.aspx</link><description>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.&lt;br&gt;
&lt;br&gt;
This also suggests an enhancement request:  CurrentUserChanging event, which might be cancelable.</description><pubDate>Thu, 20 Nov 2008 17:31:20 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: Is it possible to temporarily apply admin or last logged in user rights in order to close forms?</title><link>http://forum.strataframe.net/FindPost20819.aspx</link><description>I have gotten this far in the &lt;FONT size=2&gt;AfterSessionLock event:&lt;/FONT&gt;&lt;/P&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;&lt;P&gt;[codesnippet]&lt;/P&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;&lt;P&gt;SFSUsersBO&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; sfs = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;SFSUsersBO&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt;();&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;sfs.FillByUserName(_LastUserLoggedIn);&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;SecurityBasics&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;.CurrentUser = MicroFour.StrataFrame.Security.&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;LoggedInUser&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;.CreateNew(sfs);&lt;/P&gt;&lt;/FONT&gt;&lt;P&gt;[/codesnippet]&lt;/P&gt;&lt;P&gt;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:&lt;/P&gt;&lt;P&gt;As always all feed back is appreciated.&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;/P&gt;&lt;/FONT&gt;</description><pubDate>Thu, 20 Nov 2008 15:11:50 GMT</pubDate><dc:creator>Cory Cookson</dc:creator></item><item><title>RE: Is it possible to temporarily apply admin or last logged in user rights in order to close forms?</title><link>http://forum.strataframe.net/FindPost20818.aspx</link><description>These are great suggestions.&amp;nbsp; Thank you both.&lt;/P&gt;&lt;P&gt;Let me try to explain again.&amp;nbsp; &lt;/P&gt;&lt;P&gt;If a user with the same rights logs in after me they should see all of the forms still open.&amp;nbsp; However,&amp;nbsp;if a user with less rights logs in then all forms should close for that user.&amp;nbsp; &lt;/P&gt;&lt;P&gt;This is an issue because by the time the &lt;FONT size=2&gt;CurrentUserChanged &lt;/FONT&gt;or &lt;FONT size=2&gt;AfterSessionLock &lt;/FONT&gt;events fire the new user does not have rights to close the open forms.&lt;/P&gt;&lt;P&gt;Is there a way to temporarily create and login an admin user behind the scenes to close the open forms and then restore the user logging in or a way to temporarily elevate the users rights to admin, close the forms and then return the users rights to what they were before i modified them?&lt;/P&gt;&lt;P&gt;or.....am I missing something silly:hehe:</description><pubDate>Thu, 20 Nov 2008 14:34:09 GMT</pubDate><dc:creator>Cory Cookson</dc:creator></item><item><title>RE: Is it possible to temporarily apply admin or last logged in user rights in order to close forms?</title><link>http://forum.strataframe.net/FindPost20815.aspx</link><description>And/or the CurrentUserChanged event:&lt;/P&gt;&lt;P&gt;[codesnippet]&lt;FONT size=2&gt;MicroFour.StrataFrame.Security.SecurityBasics.CurrentUserChanged&lt;/FONT&gt;[/codesnippet]&lt;/P&gt;&lt;P&gt;There is also a BeforeSessionLocked event.&amp;nbsp; Between all of these you should be able to implement your logic.</description><pubDate>Thu, 20 Nov 2008 09:56:44 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Is it possible to temporarily apply admin or last logged in user rights in order to close forms?</title><link>http://forum.strataframe.net/FindPost20814.aspx</link><description>Hi Cory.&lt;P&gt;Guess you could add a handler to AfterSessionLock and take care of your open forms in it. But what if you have uncommited changes to be saved? &lt;/P&gt;&lt;P&gt;Maybe, in your MDI form Load:&lt;/P&gt;&lt;P&gt;[codesnippet]&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;&lt;P&gt;&lt;FONT color=#1f5080&gt;AddHandler MicroFour.StrataFrame.Security.SessionLock.AfterSessionLock, AddressOf HandleAfterSessionLock&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;[/codesnippet]&lt;/P&gt;&lt;P&gt;Then:&lt;/P&gt;&lt;P&gt;[codesnippet]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Public Sub HandleAfterSessionLock(ByVal sender As Object, ByVal e As EventArgs)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '-- check if there are open forms and take your actions&lt;/P&gt;&lt;P&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub&lt;BR&gt;[/codesnippet]</description><pubDate>Thu, 20 Nov 2008 09:09:04 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item></channel></rss>