Fixing an issue with output parameters that are of type IntPtr
[castle.git] / Experiments / Attic / Security / Castle.Services.Security / Attributes.cs
blobcba0a460a25a06948adad7b79391ee452468ed37
1 // Copyright 2004-2008 Castle Project - http://www.castleproject.org/
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
15 namespace Castle.Services.Security
17 using System;
19 [AttributeUsage(AttributeTargets.Class, AllowMultiple=false)]
20 public class SecureAttribute : System.Attribute
24 [AttributeUsage(AttributeTargets.Method, AllowMultiple=false)]
25 public class DenyAttribute : PermissionAttribute
27 public DenyAttribute(String role) : base(role){}
28 public DenyAttribute(String[] roles) : base(roles){}
31 [AttributeUsage(AttributeTargets.Method, AllowMultiple=false)]
32 public class AllowAttribute : PermissionAttribute
34 public AllowAttribute(String role) : base(role){}
35 public AllowAttribute(String[] roles) : base(roles){}
38 [AttributeUsage(AttributeTargets.Method, AllowMultiple=false)]
39 public abstract class PermissionAttribute : System.Attribute
41 public PermissionAttribute(String role) : this(new String[] {role}){}
42 public PermissionAttribute(params String[] roles)
44 this._roles = roles;
46 private String[] _roles;
48 public String[] Roles
50 get { return this._roles; }