TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
jasminie
NA
78
0
C#.net permissions
Aug 30 2011 9:55 AM
Does the following check to see the user has permissions by looking at the active directory for looking at a particualr group?
[STAThread]
static void Main()
{
// Set the thread principal to the current windows identity principal
AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal);
Thread.CurrentPrincipal = new WindowsPrincipal(WindowsIdentity.GetCurrent());
if (!Thread.CurrentPrincipal.IsInRole("SomeRoleToTest"))
{
// Alert the user they need to be granted permissions
}
else
{
// User has rights, allow mains screen to load
Application.Run(new MainWindow());
}
}
Reply
Answers (
1
)
Suppress Formula Fields And Text Object In Crystal Reports
How to find a common one values from number items from a datatable