How to set Full folder Access rights for getting file Access (Read/Write)

Hi

I am working on web application through which I am modifying XML file saved in folder.

When I try to save the modified XML file  through the application, I am getting the error

"Access to the path 'D:\CT.Sharedconfig\ConfigFiles\CT\CreditCards.xml' is denied"

I searched a lot for this , but most of solutions suggested to set access permissions for this folder manually.

If I add user "everyone" through Security tab of permissions Window (shown by right click on the required folder in explorer) and set full access rights to this user, then application works fine without raising the above error.

But I dont want this to be done manually.I want to do all the above steps programatically.

So  How to set Full access permissions to the parent folder containing required files to be manipulated , so that I can do the file manipulation operations as per requirement?

Thank you,

Sarang D


Sarang.Deshpande
0
sarang_for_forum
1/25/2008 7:41:48 AM
asp.net.security 27051 articles. 1 followers. Follow

2 Replies
1231 Views

Similar Articles

[PageSpeed] 27

Hi Sarang,

You can set the permissions programmatically through the web.config file:

HOW TO: Control Authorization Permissions in an ASP.NET Application

Thanks.
 

 

0
cmd_17
1/25/2008 9:27:39 PM

Hi
It's not difficult to set DirectorySecurity in ASP.NET application, Please have a look at this link about how to add and remove an access control entry (ACE) from a file or directory  http://msdn2.microsoft.com/en-us/library/system.security.accesscontrol.filesystemaccessrule.aspx

However, You need to impersonate a powerful user like this in the web.config since by default ASP.NET account don't have those permission.
 <identity impersonate="true" userName="adminUser" password="adminPassword" />


Best Regards
XiaoYong Dai
Microsoft Online Community Support

Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
0
XiaoYong
1/28/2008 10:59:29 AM
Reply:

Similar Artilces:

Nobody can read my tasks even with security proxy settings set to full access
--____LPHMXLZMXOMRLFKSEJCW____ Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable We use Groupwise 6.5 without SP. other users cant read my tasks even with = proxy security setting set to full access. Can someone help me out ? --____LPHMXLZMXOMRLFKSEJCW____ Content-Type: multipart/related; boundary="____WHPEPQYSAQXEHDGESJXG____" --____WHPEPQYSAQXEHDGESJXG____ Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: quoted-printable <HTML><HEAD> <META http-equiv=3DContent-Type content=3D&q...

GET ACCESS/SECURITY RIGHTS FOR A EXE FILE
I AM ATTEMPTING TO RUN AN EXE LOCATED ON A REMOTE SERVER FROM A PB WINDOW. MY PB WINDOW WILL CRASH IF FOR EXAMPLE THE CURRENT USER ON THE LOCAL MACHINE DOES NOT HAVE REQUIRED ACCESS/SECURITY RIGHTS TO THE EXE. I HOPE TO TEST THE ACCESS RIGHTS BEFORE RUNNING THE EXE. DOES ANYONE KNOW HOW TO DETERMINE THE ACCESS/SECURITY RIGHTS OF THE EXE USING PBSCRIPT OR API OR ??? THANKS FOR ANY HELP JENNY ...

Does HttpApplicationState.Lock restricts read-write access or only write access?
In code below, does the lock also prevent another user from reading the values of  application variables 'MyCode' and 'MyCount'? Or lock only prevents writing to these application variables? Application.Lock();Application["MyCode"] = 21;Application["MyCount"] = Convert.ToInt32(Application["MyCount"]) + 1;Application.UnLock();  sun21170 According to the documentation (Application.Lock Method [IIS]):The Lock method blocks other clients from modifying the variables stored in the Application object, ensuring that only one client at a time can alter or access the Applicatio...

Folder/File Access rights?
How can you find out if you have access rights to a folder and/or a file? Jacob ...

Can update access file but not write access problem!
Hi all, I cannot seem to update my access database. No errors where given and I definitely can write into the database. My codes are as shown. Dim ID as Integer = Cint(Request.QueryString("GV"))    Dim SettingName as String = TextBox1.Text.ToString()    Dim strSQL as String = "UPDATE [ParameterSetting] SET [SettingName]=@SettingName WHERE ([GroupOfValues] = @ID)"     Dim strConnString as String = ConfigurationSettings.Appsettings("connectionString")    Dim objConn as New OleDbConnection(strConnString)    objConn.Op...

Write a file from ms access to folder
hello,  i want to send mail using .net , first i stored all content in MS Access like from,to,subject & save attachement file to ms access database . and after i want send  file stored in ms access  to email , ie. i want to send email . then what is code for it, i used vb language . please help me soon.   There are too many variables here, to give you an exact answer. I'm not sure how you want to get the email address to send, and I'm not sure how you want to get the content from the database. Also - will the data in the database be different for ea...

Access access
========== Hi, Everyone ... I'm going to lock this thread for now. If you have a question about working with Access in Web Matrix, please start a new thread in this forum. Otherwise, this thread will get to be unwieldy. Thanks! ========== Updated 6/29/03 Hello, everyone. I've been working with the new version of Web Matrix (version .6, build 812, available right now!). In particular, I've been playing with support for Microsoft Access, which is one of the great new features in the new release. I wrote up some notes on what I've found to share some of my experiences and to a...

Access to path was denied. The location does not exist or is not accessible because of security settings.
After spending the better part of 8 hours rewriting my website from html to asp pages using Microsoft Visual Web Developer 2005 Epress Edition I only have 1 major problem. I can view the project on my computer just fine with the database information being displayed correctly. My hosting company can view the data just fine, even my roomates computer works good. However whenever I try to view the website on my computer I get the following error. It works locally on my computer, but once I upload it, any page that displays data from a database file shows this error. It works on other computers ...

Security
What do I do my admin folder so that it contents are only accessible to users logged in with role of Administrator?  Thank you,   Put a web.config in the admin folder, with the following content: <?xml version="1.0" encoding="utf-8"?><configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">    <system.web>        <authorization>            <allow roles="Administrator" />         &nb...

accessing access
------=_NextPart_000_029B_01C29063.1E2098D0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Hi! I am trying to access an access mdb file for the first time. I get the following error: Can't connect(dbi::ODBC:pfawtbls.mdb ), no database driver specified and DBI_DSN env var not set at jfa_data.pl line 147 for the code: my $dbh = DBI->connect( "dbi::ODBC:pfawtbls.mdb", "", "", ) or die "Unable to connect: ". $DBI::errstr. "<br>"; What am I missing? Thanks, Jer...

Cannot access website (files in a folder); but can access in local machine.
 Hi, I can run my Employer website in my local machine when I run it from the visual studio. But, I uploaded the site now. I can access all aspx pages except the pages in 'Employer' folder. Employer folder should be accessed by Employer and Administrator roles. I already set those roles in my ASP.NET Administrator tool. When I try to login as an Employer and try to access the pages like ~/Employer/Default.aspx, I can't access them. I can access them when I run it in  my local machine from Visual Studio. I don' t find any error in my database. Any idea. Than...

Hw access files in FTP folder with .NET
Hi,Is it possible to access access a ftp folder and its files (both upload and download) from my .NET application.  Please forward me some samples.regards,Sreejith Sreejithhttp://tips4dotnet.blogspot.com/ Hi,     Have a look on this thread,      http://forums.asp.net/t/1248931.aspx   Regards,SasiPlease remember to click "Mark as Answer" on this post if it helped you. Hi,Check this links.. it helps you..http://www.codeproject.com/KB/IP/FtpClient.aspxhttp://msdn.microsoft.com/en-us/library/system.net.ftpwebrequest.aspx &nb...

Full file access but cannot create any folder/subfolder?
Hi, Can anyone help that we would like our user to have full file access right under the folder/subfolder but won't let them to create folder/subfolder? Can it be done and how? Kindly advise. Many thanks, TK No, as directories are merely a special case of files, so the only way to stop directories being created is to stop any files being created - this is probably not an option for you. Cheers Dave -- Dave Parkes [NSCS] Occasionally resident at http://support-forums.novell.com/ ...

security implications for write access to web folders
Hi people, I would like your opinions on the security implications of giving write access to web folders. Suppose, i have a virutal directory mapped to a folder like D:\inetpub\myweb which maps to the URL http://www.myproject/myweb/index.aspx and the ASPNET process has read/write access to this folder. Now this website performs standard tasks like authentication, fetching & saving values to a database and display resulst to users. It performs no Filesystem IO operations. Why is giving write access to the folder bad (other than the guiding principle of "grant only the minimum acce...

Web resources about - How to set Full folder Access rights for getting file Access (Read/Write) - asp.net.security

Bernie Sanders May Have A Secret Weapon That Could Knock Hillary Clinton Off In Iowa
Bernie Sanders needs Iowa, a small but important early voting state that could sway support to Sanders, and over the past few weeks the campaign ...

Asia stocks start 2016 on weak note as Middle East weighs
SEOUL, South Korea (AP) — Asian stock markets started 2016 on a weak note Monday as poor manufacturing data from the world's second-largest economy ...

Battle for Control of Indian Air Base Enters 2nd Night
Voice of America Battle for Control of Indian Air Base Enters 2nd Night Voice of America Last updated on: January 03, 2016 7:37 PM. NEW DELHI—. ...

Oregon ‘Militia’ Video: ‘We Need You To Bring Your Arms’ As Cartoon Comparing Tamir Rice To Oregon Attack ...
The “ Oregon Under Attack ” situation rolls on, as the controversy continues to be compared to other uprisings comparing the races of the folks ...

Marco Rubio Promises to Reverse Obama’s Planned Gun Limits
Presidential hopeful Marco Rubio is promising that he would reverse President Obama’s executive action on gun rights on his first day in the ...

‘Star Wars’, Chinese, Italian & Family Pics Lead; ‘Sherlock’ Shines In Korea – Intl B.O.
In a very similar situation to last weekend , Star Wars : The Force Awakens continued its hyper-drive through offshore markets this frame, while ...

Lenovo X1 YOGA With 360-degree OLED Display
Despite the success of the Lenovo X1 Carbon, Lenovo has without a doubt been ask very often about why that model could not swivel all the way ...

Chris Brown I'm On the Attack Now I'm Suing My Accuser
TMZ.com Chris Brown I'm On the Attack Now I'm Suing My Accuser TMZ.com 0103-chris-brown-liziane-gutierrez-TMZ-02 Chris Brown has a warning ...

3 Held in Slaying of Mexico Mayor a Day After Taking Office
CBS News 3 Held in Slaying of Mexico Mayor a Day After Taking Office New York Times MEXICO CITY — Three people, including a minor, were being ...

Lenovo ushers in CES 2016 with a dozen new devices
Lenovo is getting CES 2016 off to quite a start, taking the wraps off a dozen new devices, most of which are laptops and hybrids. Tossed in among ...

Resources last updated: 1/4/2016 4:34:18 AM