M
Martin
Hi all,
Those days, I explore the System.Security namespace but, of course, I
have a question.
I really appreciate the way we can secure a method with the
PrincipalPermissionAttribute above the method signature. In the
following case, to execute the function, the user must be Bob and his
role must be Supervisor. So far, everything is OK.
[PrincipalPermissionAttribute(SecurityAction.Demand, Name="Bob",
Role="Supervisor")]
public void MaSuperFonction()
{
Console.WriteLine("Allô!");
}
Now, why I can't do that?
[PrincipalPermissionAttribute(SecurityAction.Demand,
Name=GetAllowedUsers(), Role=GetAllowedRoles())]
public void MaSuperFonction()
{
Console.WriteLine("Allô!");
}
I can't beleive that I have to hardcode Users and Roles to use
Microsoft security...
Thanks for you help!
Martin
Those days, I explore the System.Security namespace but, of course, I
have a question.
I really appreciate the way we can secure a method with the
PrincipalPermissionAttribute above the method signature. In the
following case, to execute the function, the user must be Bob and his
role must be Supervisor. So far, everything is OK.
[PrincipalPermissionAttribute(SecurityAction.Demand, Name="Bob",
Role="Supervisor")]
public void MaSuperFonction()
{
Console.WriteLine("Allô!");
}
Now, why I can't do that?
[PrincipalPermissionAttribute(SecurityAction.Demand,
Name=GetAllowedUsers(), Role=GetAllowedRoles())]
public void MaSuperFonction()
{
Console.WriteLine("Allô!");
}
I can't beleive that I have to hardcode Users and Roles to use
Microsoft security...
Thanks for you help!
Martin