2004-11-15 Sebastien Pouliot <sebastien@ximian.com>
[mono.git] / mono / mini / declsec.c
1 /*
2  * declsec.c:  Declarative Security support
3  *
4  * Author:
5  *      Sebastien Pouliot  <sebastien@ximian.com>
6  *
7  * Copyright (C) 2004 Novell, Inc (http://www.novell.com)
8  */
9
10 #include "declsec.h"
11
12 /*
13  * Does the methods (or it's class) as any declarative security attribute ?
14  * Is so are they applicable ? (e.g. static class constructor)
15  */
16 MonoBoolean
17 mono_method_has_declsec (MonoMethod *method)
18 {
19         if (method->wrapper_type != MONO_WRAPPER_NONE)
20                 return FALSE;
21                 
22         if ((method->klass->flags & TYPE_ATTRIBUTE_HAS_SECURITY) || (method->flags & METHOD_ATTRIBUTE_HAS_SECURITY)) {
23                 /* ignore static constructors */
24                 if (strcmp (method->name, ".cctor"))
25                         return TRUE;
26         }
27         return FALSE;
28 }