mapping specific rolename to methods in EJB

Posted on 2004-11-19
Last Modified: 2013-11-24
i am using oc4j container9.0.3

isay this statelesssessionbean
in my ejb-jar.xml i will give access generateBillingmethod to 'myMgr'  only other than myMgr no body can access my method;;


in session bean how can i write  logic that only 'myMgr' can access this method;

Question by:chaitu chaitu
    1 Comment
    LVL 13

    Accepted Solution

    u can do this declarativlly like this:

    1- in ur ejb.jar.xml:

            <method-intf>Local {or Remote or Both}</method-intf>

    2- in ru orion-ejb-jar.xml do this:

            <security-role-mapping name="myMgr">
                <group name="myMgr" />
                <security-role-mapping name="&lt;default-ejb-caller-role&gt;" impliesAll="true" />

    3- in ur oc4j j2ee\home\config\principals.xml add a user and a group:

            <group name="myMgr">

            <user username="MyMgrUser" password="password">
                <description>no description</description>
                <group-membership group="myMgr" />

    then u r sure that only member of MyMgr group can access the EJB API

    u can also check that programatically if u called:



    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    Java MSI Solution 3 53
    sumHeights  challenge 17 51
    How Complex Is This Java Course ? 9 52
    computer science syllabus 3 41
    Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
    Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
    Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
    This video teaches viewers about errors in exception handling.

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now