X
xenophon
I am using Role-based seucity Attributes on different methods in my
code-behind like this:
private void callmymethod()
{
try
{
mymethod();
}
catch{}
PrincipalPermission(SecurityAction.Demand , Role="1")]
private void mymethod()
{
}
Then any work in mymethod will fail quietly if the Principal does not
have a "1" role.
I want the same silent-fail on events that are wired to controls, but
I don't see how to do that. How do I do that on an event like this:
PrincipalPermission(SecurityAction.Demand , Role="1")]
private void button1_clic( object sender , EventArgs e )
{
}
Right now when the button is clicked, if the Principal does not have
the Role, the whole app grinds to a halt with an Exception.
Thanks.
code-behind like this:
private void callmymethod()
{
try
{
mymethod();
}
catch{}
PrincipalPermission(SecurityAction.Demand , Role="1")]
private void mymethod()
{
}
Then any work in mymethod will fail quietly if the Principal does not
have a "1" role.
I want the same silent-fail on events that are wired to controls, but
I don't see how to do that. How do I do that on an event like this:
PrincipalPermission(SecurityAction.Demand , Role="1")]
private void button1_clic( object sender , EventArgs e )
{
}
Right now when the button is clicked, if the Principal does not have
the Role, the whole app grinds to a halt with an Exception.
Thanks.