01: /**
02: * EasyBeans
03: * Copyright (C) 2006 Bull S.A.S.
04: * Contact: easybeans@ow2.org
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation; either
09: * version 2.1 of the License, or any later version.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: *
16: * You should have received a copy of the GNU Lesser General Public
17: * License along with this library; if not, write to the Free Software
18: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19: * USA
20: *
21: * --------------------------------------------------------------------------
22: * $Id: ISecurityInfo.java 1970 2007-10-16 11:49:25Z benoitf $
23: * --------------------------------------------------------------------------
24: */package org.ow2.easybeans.api.bean.info;
25:
26: import java.util.List;
27:
28: import javax.security.auth.Subject;
29:
30: /**
31: * Runtime info about security.
32: * @author Florent Benoit
33: */
34: public interface ISecurityInfo {
35:
36: /**
37: * Adds a role for this bean (for isCallerInRole).
38: * @param roleName the name of a role.
39: */
40: void addDeclaredRole(String roleName);
41:
42: /**
43: * Sets the list of declared roles.
44: * @param declaredRoles list of declared roles.
45: */
46: void setDeclaredRole(List<String> declaredRoles);
47:
48: /**
49: * @return list of roles declared for this bean.
50: */
51: List<String> getDeclaredRoles();
52:
53: /**
54: * Adds a method containing security.
55: * @param methodSecurityInfo the info about security.
56: */
57: void addMethodSecurityInfo(IMethodSecurityInfo methodSecurityInfo);
58:
59: /**
60: * @return list of security infos on all methods.
61: */
62: List<IMethodSecurityInfo> getMethodSecurityInfos();
63:
64: /**
65: * Sets the name of the run-as security role.
66: * @param runAsRole the name of the role.
67: */
68: void setRunAsRole(String runAsRole);
69:
70: /**
71: * Gets run-as name.
72: * @return the name of the security role for the run-as.
73: */
74: String getRunAsRole();
75:
76: /**
77: * Gets run-as role subject.
78: * @return a subject with run-as role as role.
79: */
80: Subject getRunAsSubject();
81:
82: }
|