Controlling access to method's in C#
Posted
by
user460103
on Stack Overflow
See other posts from Stack Overflow
or by user460103
Published on 2012-09-25T03:03:56Z
Indexed on
2012/09/25
3:37 UTC
Read the original article
Hit count: 100
Is there a way to control access to methods to certain roles in .net. Like
class A
{
//should only be called by Admins**
public void Method1() { }
//should only be called by Admins and PM's**
public void Method2() { }
}
I'm using windows authentication only for retrieving user names and nothing more.User roles are maintained in a different application. I think it's possible through attributes but I'm not really sure how
© Stack Overflow or respective owner