StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      



Access to registry key denied with standard...Expand / Collapse
Author
Message
Posted 10/21/2007 8:20:44 AM
StrataFrame Beginner

StrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame Beginner

Group: Forum Members
Last Login: 05/13/2008 12:20:39 PM
Posts: 5, Visits: 23
I've installed Role based security and everything works fine based on the following conditions.

While logging into a domain and the windows user account is set as power-user or Administrator then everything is fine. If the user logging is a  restricted user (Windows users group) then I get the following error:


  Access to the registry key 'HKEY_LOCAL_MACHINE\Software\MicroFour\StrataFrame\Security\LoginForm' is denied.

Source     : mscorlib

Stack Trace:
   at Microsoft.Win32.RegistryKey.Win32Error(Int32 errorCode, String str)
   at Microsoft.Win32.RegistryKey.CreateSubKey(String subkey, RegistryKeyPermissionCheck permissionCheck, RegistrySecurity registrySecurity)
   at Microsoft.Win32.RegistryKey.CreateSubKey(String subkey)
   at Microsoft.Win32.Registry.SetValue(String keyName, String valueName, Object value, RegistryValueKind valueKind)
   at MicroFour.StrataFrame.Win32.RegistryRepository.WriteValue(String ValueName, String Value)
   at Primary_Reports.CustomLogin.cmdOk_Click(Object sender, EventArgs e)
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.PerformClick()
   at System.Windows.Forms.Form.ProcessDialogKey(Keys keyData)
   at System.Windows.Forms.ContainerControl.ProcessDialogKey(Keys keyData)
   at System.Windows.Forms.TextBoxBase.ProcessDialogKey(Keys keyData)
   at System.Windows.Forms.Control.PreProcessMessage(Message& msg)
   at System.Windows.Forms.Control.PreProcessControlMessageInternal(Control target, Message& msg)
   at System.Windows.Forms.Application.ThreadContext.PreTranslateMessage(MSG& msg)

The only way at the moment to get everyone up and running is to change there access level in windows. Is this by design or a bug?

Thanks

Nader

Post #12130
Posted 10/22/2007 9:10:24 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: 09/26/2008 8:30:36 AM
Posts: 2,685, Visits: 1,886
The login form is trying to save off the username that was entered.  The custom login form template does that for you, however, with restricted rights on the computer, you won't be able to do that.  So, you'll need to modify your CustomLogin class to remove the writing of the registry value from the cmdOK_Click event handler.


www.bungie.net
Post #12131
Posted 10/22/2007 11:51:15 PM
StrataFrame Beginner

StrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame Beginner

Group: Forum Members
Last Login: 05/13/2008 12:20:39 PM
Posts: 5, Visits: 23
How could I test for the users windows security level(ie restricted, standard, Administrator)?. Is there any method in Statraframe or would I have to use the windows API

Nadr

Post #12141
Posted 10/23/2007 8:44:24 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: 09/26/2008 8:30:36 AM
Posts: 2,685, Visits: 1,886
Well, you could create a custom method to try writing to the registry within a try/catch... catch the security exception that is thrown and you'll know the user has reduced privileges.  Otherwise, you're probably down to using LDAP + System.DirectoryServices.ActiveDirectory or maybe some API calls.


www.bungie.net
Post #12144
Posted 10/23/2007 12:35:13 PM
StrataFrame Beginner

StrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame Beginner

Group: Forum Members
Last Login: 05/13/2008 12:20:39 PM
Posts: 5, Visits: 23
Thanks, the try catch seems the easiest solution.

Nadr

Post #12148
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Ben Chase, Trent L. Taylor, Steve L. Taylor

PermissionsExpand / Collapse

All times are GMT -6:00, Time now is 9:55am

Powered by InstantForum.NET v4.1.4 © 2008
Execution: 0.063. 10 queries. Compression Enabled.
Site Map - Home - My Account - Forum - About Us - Contact Us - Try It - Buy It

Microsoft, Visual Studio, and the Visual Studio logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.