0 Replies Latest reply on Mar 27, 2002 9:19 PM by legolas71

    How to set ejb security

    legolas71 Newbie


      Hi all ,

      I am using jBoss2.1 , jdk1.3 and Apache Tomcat 1.3.14.

      I have setup security in ejb-jar.xml as below :
      However i have tried to called method below :

      boolean iscreate = entityContext.isCallerIsRole("create");
      it always gave me false value , it should be true .
      Any ideas ? Thanks

      <?xml version="1.0" encoding="ISO-8859-1"?>

      <!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN' 'http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd'>

      <ejb-jar>
      Enterprise Beans for Project: stafflog.jpr
      <enterprise-beans>

      <ejb-name>Staffloginlog</ejb-name>
      com.hdbay.stafflog.StaffloginlogHome
      com.hdbay.stafflog.Staffloginlog
      <ejb-class>com.hdbay.stafflog.StaffloginlogBean</ejb-class>
      <persistence-type>Container</persistence-type>
      <prim-key-class>com.hdbay.stafflog.StafflloginlogPK</prim-key-class>
      False
      <cmp-field>
      <field-name>staffid</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>staffno</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>logindate</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>logintime</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>loginip</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>loginstatus</field-name>
      </cmp-field>
      <security-role-ref>
      <role-name>create</role-name>
      <role-link>tat</role-link>
      </security-role-ref>
      <resource-ref>
      <res-ref-name>jdbc/InternalDS</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
      </resource-ref>

      </enterprise-beans>
      <assembly-descriptor>
      <security-role>
      <role-name>tat</role-name>
      </security-role>
      </assembly-descriptor>
      </ejb-jar>