1 // Copyright 2004-2008 Castle Project - http://www.castleproject.org/
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
7 // http://www.apache.org/licenses/LICENSE-2.0
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
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
)
46 private String
[] _roles
;
50 get { return this._roles; }