| | |
How can we assign or revok permission to users on apllications through C#.NET?
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Sep 2009
Posts: 1
Reputation:
Solved Threads: 0
How can we give permissions or revoke permissions on applications(i.e installed softwares) for a user via c#.net.
i have get the all uers list on the computer and also installed programs list but how can i change a user permissions in a way that he may not able to use some specific application like photoshop, corel draw.
Detailed Description of Problem
I have three users 'A' , 'B' and 'C' on my Computer (Standalone) . I want that Only User 'A' can use Photoshop and User 'B' can only use coreldraw. So how we can give permissions to User 'A' and 'B'. I want to do this programmaticaly through C#.NET.
please help me to solve this problem.
Thanks
i have get the all uers list on the computer and also installed programs list but how can i change a user permissions in a way that he may not able to use some specific application like photoshop, corel draw.
Detailed Description of Problem
I have three users 'A' , 'B' and 'C' on my Computer (Standalone) . I want that Only User 'A' can use Photoshop and User 'B' can only use coreldraw. So how we can give permissions to User 'A' and 'B'. I want to do this programmaticaly through C#.NET.
please help me to solve this problem.
Thanks
•
•
Join Date: Jul 2009
Posts: 903
Reputation:
Solved Threads: 144
Re: How can we assign or revok permission to users on apllications through C#.NET?
0
#2 Sep 18th, 2009
Not sure how you would do that by registered application, but here is a good link/example code showing how to add/revoke privileges to particular directory for user. You could change it also to use the File class objects instead of the Directory objects if you desire. I know it's probably not exactly what you are looking for, but maybe a workaround if needed:
Security Access Control
Security Access Control
Re: How can we assign or revok permission to users on apllications through C#.NET?
0
#3 Sep 18th, 2009
I can suggest to use AOP http://www.postsharp.org it helps very well...
BI Developer | LINKdotNET
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
•
•
Join Date: Jul 2009
Posts: 903
Reputation:
Solved Threads: 144
Re: How can we assign or revok permission to users on apllications through C#.NET?
0
#4 Sep 18th, 2009
I found this code, but havn't tried it. It shows how to revoke registry privilege for software application, and I think it might be more of what you are looking for.
I believe that if you call the above with the
C# Syntax (Toggle Plain Text)
public static void RevokeRegKeyRights(RegistryKey regKey, NTAccount user, RegistryRights rightsFlags, InheritanceFlags inherFlags, PropagationFlags propFlags, AccessControlType actFlags) { RegistrySecurity regSecurity = regKey.GetAccessControl(); RegistryAccessRule rule = new RegistryAccessRule(user, rightsFlags, inherFlags, propFlags, actFlags); regSecurity.RemoveAccessRuleSpecific(rule); regKey.SetAccessControl(regSecurity); }
I believe that if you call the above with the
RegistryRights.ExecuteKey option, it should prevent that user from launching the application: C# Syntax (Toggle Plain Text)
NTAccount user = new NTAccount(@"WRKSTN\ST"); using (RegistryKey regKey = Registry.LocalMachine.OpenSubKey( @"SOFTWARE\MyCompany\MyApp")) { RevokeRegKeyRights(regKey, user, RegistryRights.ExecuteKey, InheritanceFlags.None, PropagationFlags.None, AccessControlType.Allow); }
Re: How can we assign or revok permission to users on apllications through C#.NET?
0
#5 Sep 18th, 2009
Sorry you need to apply permission on your developed application or another applications
In case of another applications, you may the one who has the administrative permission and when install log on the i.e. 'A' account and right click on the exe and run it as administrator enter your username and password and in installation progress say just for this user. (Just if the application supports that)
You need to disable some user permissions....
In case of another applications, you may the one who has the administrative permission and when install log on the i.e. 'A' account and right click on the exe and run it as administrator enter your username and password and in installation progress say just for this user. (Just if the application supports that)
You need to disable some user permissions....
BI Developer | LINKdotNET
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
Re: How can we assign or revok permission to users on apllications through C#.NET?
0
#6 Sep 19th, 2009
![]() |
Similar Threads
- Displaying Pages Dynamic to users (ASP.NET)
- ASP.NET vs WPF (ASP.NET)
- vb.net 08 Reading data from multiple reg keys (VB.NET)
- HELP WITH SOUND CARD - 82801FB ICH6 AC'97 Audio Controller - (PCI and Add-In Cards)
- Problem while giving permission to a file in windows 2003 server (Windows NT / 2000 / XP)
- Problem while giving permission to a file in windows 2003 server (Windows Servers and IIS)
- Database Security question (Database Design)
- C# and .Net 1.0 (C#)
- Send message to users in client PC (ASP.NET)
- Project Enazen Seeks Staff Members (Web Development Job Offers)
Other Threads in the C# Forum
- Previous Thread: String formatting
- Next Thread: Need Help in Regex?
| Thread Tools | Search this Thread |







