![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Overriding System Permissions We have a ploicy where the executable resides in a folder which has only got the permissions set for the user to have: Read&Execute, ListFolderContents, Read. We have an INI file and an xml file in the same folder to load specific parameters such as default servername at startup. We need to be able to modify these files from within the program. However when we try to write to these files we get a permissions error. We need a means of being able to override these permissions from within the application temporarily so that the new settings can be stored. Does anyone know how this can be achieved? Thanks in advance. |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Overriding System Permissions ngrTerry wrote: Quote: > We have a ploicy where the executable resides in a folder which has > only got the permissions set for the user to have: > Read&Execute, ListFolderContents, Read. > > We have an INI file and an xml file in the same folder to load > specific parameters such as default servername at startup. We need to > be able to modify these files from within the program. > > However when we try to write to these files we get a permissions > error. > > We need a means of being able to override these permissions from > within the application temporarily so that the new settings can be > stored. > user, because the application is always acting on behalf of the user. You could make the application temporarily impersonate a user with more permissions, but then, again, this means that the original user is able to do this as well (although they may have to go to some trouble to find out where the password is stored). What you can do is reset the permissions on the files that need to be modifiable so they no longer inherit their permissions from the folder, and instead allow them to be modified by users. If all you need is a way to make sure the settings aren't *accidentally* modified, you can simply set the read-only attribute. Alternatively and more securely, if the users should not be allowed to overwrite all settings, you should split the settings into a part that may not be modified on a per-user basis (storing this within the application folder) and settings that may be modified on a per-user basis (storing these within the user's application data folder). .NET uses a cascading mechanism where multiple configurations are combined to form one. Consult the documentation on configuration files for more information. -- J. |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| System Permissions (followup) | .NET General | |||
| Programs - Replace System Program without Modifying System Files or Permissions | Tutorials | |||
| Vista overriding my permissions | General Discussion | |||
| Permissions for system files | Vista file management | |||
| Overriding a password? | Vista account administration | |||