G
Guest
After reading Eugene Bobukh's blog entry about creating custom non-CAS
permissions, I developed a few custom permissions to satisfy the needs of an
application I'm currently working on.
For reference, the blog entry I'm referring to can be found here:
http://blogs.msdn.com/eugene_bobukh/archive/2004/03/10/87645.aspx
Everything Eugene talked about works fine, but one thing that doesn't seem
to work is using custom permissions with the SecurityManager.IsGranted
method. When SecurityManager.IsGranted is called, IPermission.IsSubsetOf
gets called as well, but the IPermission target parameter is always null. I
verified that this happens with Euguene's sample code as well.
For example:
WorkingTimePermission p = new WorkingTimePermission();
if (SecurityManager.IsGranted(p))
{
// Enable application UI tabs which should be available only during
working hours.
}
When stepping through the code, SecurityManager.IsGranted does some
processing and then WorkingTimePermission.IsSubsetOf gets called, but with a
null IPermission target parameter.
Can anyone shed some light on why this may be happening?
Thanks in advance,
Jason
permissions, I developed a few custom permissions to satisfy the needs of an
application I'm currently working on.
For reference, the blog entry I'm referring to can be found here:
http://blogs.msdn.com/eugene_bobukh/archive/2004/03/10/87645.aspx
Everything Eugene talked about works fine, but one thing that doesn't seem
to work is using custom permissions with the SecurityManager.IsGranted
method. When SecurityManager.IsGranted is called, IPermission.IsSubsetOf
gets called as well, but the IPermission target parameter is always null. I
verified that this happens with Euguene's sample code as well.
For example:
WorkingTimePermission p = new WorkingTimePermission();
if (SecurityManager.IsGranted(p))
{
// Enable application UI tabs which should be available only during
working hours.
}
When stepping through the code, SecurityManager.IsGranted does some
processing and then WorkingTimePermission.IsSubsetOf gets called, but with a
null IPermission target parameter.
Can anyone shed some light on why this may be happening?
Thanks in advance,
Jason