KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > test > jbossnet > security > server > AuthorizationBean


1 /*
2  * JBoss, the OpenSource J2EE webOS
3  *
4  * Distributable under LGPL license.
5  * See terms of license at gnu.org.
6  */

7  
8 package org.jboss.test.jbossnet.security.server;
9
10 import org.jboss.test.util.ejb.SessionSupport;
11
12 /**
13  * Non-secured session bean to test web service authorization.
14  * @author jung
15  * @version $Revision: 1.1.1.1.6.1 $
16  * @ejb.bean name="Authorization"
17  * display-name="Authorization Bean"
18  * type="Stateless"
19  * view-type="remote"
20  * jndi-name="security/Authorization"
21  * @ejb.interface remote-class="org.jboss.test.jbossnet.security.Authorization" extends="javax.ejb.EJBObject"
22  * @ejb.home remote-class="org.jboss.test.jbossnet.security.AuthorizationHome" extends="javax.ejb.EJBHome"
23  * @ejb.transaction type="Required"
24  * @ejb.permission unchecked="true"
25  * @jboss-net.web-service urn="Authorization"
26  * @jboss-net.authentication domain="jbossnet-tests"
27  * @jboss-net.authorization domain="jbossnet-tests" roles-allowed="Role2, Role1" roles-denied="Role3"
28  */

29
30 public class AuthorizationBean
31    extends SessionSupport implements javax.ejb.SessionBean JavaDoc
32 {
33    /**
34     * @jboss-net.web-method
35     * @ejb.interface-method view-type="remote"
36     */

37    
38    public boolean workedOut()
39    {
40       // return true if role1 is logged in
41
return sessionCtx.getCallerPrincipal().getName().equals("jduke");
42    }
43
44 }
45
Popular Tags