473,396 Members | 1,987 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Setting ACLs in C# + ASPX

What is the absolute minimum permissions required to set permissions?
The following code works if the user is a member of 'Domain Admins',
(not too pumped about giving a web user those kind of privileges). Both
user are identical except that one of them is a 'Domain Admin'. They
have full control over the object they are attempting to modify and the
effective permissions tab under advanced in ADSI Edit shows that they
both have permission to read and modify the permissions on the object in
question.

Both users can modify the permissions in ASP, (basically the same
'logic' just in ASP verses ASPX), which implies that there is something
different about my ASPX code, (or the ASPX environment).

I have been banging my head against the wall on this one for a while now
so anything and everything would be appreciated.

Thanks

-Cam

------------------------------------------
The ASPX code I am attempting to use:
------------------------------------------

string DocDN = "LDAP://<some dn>";
DirectoryEntry oDE = null;

try
{
Response.Write("Attempting to retrieve - " +
DocDN + "<br>\n");
// USER 1
//oDE = new DirectoryEntry(DocDN, "APPDEPOT\\<SAM1>",
"<Password 1>"); //user 1

// USER 2
//oDE = new DirectoryEntry(DocDN, "APPDEPOT\\<SAM 2>",
"<Password 2>"); //IDX\cam user
Response.Write("Title = " +
oDE.Properties["appdepot-adxTitle"][0].ToString()+
"<br>\n");

ActiveDs.IADsSecurityDescriptor SD =
(ActiveDs.IADsSecurityDescriptor)
oDE.Properties["ntSecurityDescriptor"].Value;

/*
* Don't do anything but attempt to set it, exactly as
* you got it
*/
oDE.Properties["ntSecurityDescriptor"].Value = SD;
oDE.CommitChanges();

Response.Write("Good<br>\n");
}
catch(Exception e)
{
Response.Write("Blew Up<br><br>" + e.Message + "<br>" +
e.Source + "<br>" + e.StackTrace);
}
finally
{
oDE.Dispose();
}

Nov 18 '05 #1
0 977

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Daniel Cayouette | last post by:
in C# is there a managed code example to set ACLs on a folder. We're currently using the win32api and would like to migrate this functionality to managed code in C#
1
by: Peter Rilling | last post by:
How can I pass credentials along with a file access request. When a person uses an application, it uses their credentials when accessing resources. Now, what if the user wants to use the...
1
by: Morten | last post by:
Hi! I'm trying to figure out how to add a user with full access to an NTFS folder on a Windows 2003 Server using C# (web project). Does anyone have an example of this? I want to keep existing...
2
by: junlia | last post by:
Hi All, I am working on a project that acts as a bridge. It does some checking with post xml data, and then redirects the request to an appropriate page. However, we find that depends on the...
0
by: Sherwood | last post by:
My current scenario is users logging in to our website and being directed to a specific directory based on who they are. The ACLs on the destination result in prompts for credentials (the windows...
0
by: Marcus Dano | last post by:
Hi, I want to read all ACLs from a single folder in my NTFS partition. I'am using following code: Dim dir As DirectoryInfo = New DirectoryInfo("C:\demo") Dim sec As DirectorySecurity =...
10
by: John Salerno | last post by:
I always read about how you need to set certain file permissions (for cgi files, for example), but it's never been clear to me *how* you do this. I know you can run the line chmod 755...
0
by: Curt K | last post by:
We run some web services (IIS 5 and IIS 6) that communicate to a COM out of process server, which in turn communicates to another out of process COM server (long story). We have had lots of...
5
by: dananrg | last post by:
Is there a standard library module in Python 2.4 (Win32) that will return directory permissions / ACLs (e.g. users, groups, and what rights they have)? Otherwise, I'm faced with sending "cacls...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.