IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.



#Automation


#Applicationintegration
#webMethods
#Integration
 View Only
  • 1.  How to use checkAcl method in ServerAPI class

    Posted 04/02/09 04:19 AM

    Hi,
    I want to check if login-user has an access permission to some IS service using ACLs setting in webMethods Administrator page.

    The actions I have done are as follows

    1.add user monUser, group monGroup
    2.set monUser to be belong to monGroup
    3.add Acls monAcl
    4.set monGroup to be associated for monAcl

    then I made a java service like

    // pipeline
    IDataCursor pipelineCursor = pipeline.getCursor();
    String userid = IDataUtil.getString( pipelineCursor, “username” );
    String aclname = IDataUtil.getString( pipelineCursor, “aclname” );
    pipelineCursor.destroy();

    ServerAPI sa = new ServerAPI();
    ValuesEmulator.put(pipeline, “hasPermission”, (sa.checkAcl(aclname,userid)) ? “Y” : “N”);

    When I test with userid:monUser, aclname:monAcl, but it returns ‘N’.
    I don’t know what’s wrong about it.

    Your help will be appreciated. Thanks in advance. :slight_smile:


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 2.  RE: How to use checkAcl method in ServerAPI class

    Posted 04/02/09 09:25 AM

    I tested with following code,

    // pipeline
    IDataCursor pipelineCursor = pipeline.getCursor();
    String aclname = IDataUtil.getString( pipelineCursor, “aclname” );
    pipelineCursor.destroy();

    // Check current user is belong to acl group
    String userid = InvokeState.getCurrentUser().getName();
    ValuesEmulator.put(pipeline, “isMonitorUser”, (ServerAPI.checkAcl(aclname,userid)) ? “Y” : “N”);

    It works fine. :-<
    checkAcl() has two string type parameters.
    What I don’t understand is that the result is different in two cases.

    1.case 1

    aclname : “monAcl
    userid : “monUser (string) → displayed at Developer Results windows

    ServerAPI.checkAcl(aclname,userid) : N

    2.case 2

    aclname : “monAcl” (string)
    userid : InvokeState.getCurrentUser().getName(); monUser (string)

    ServerAPI.checkAcl(aclname,userid) : Y

    Is there good explanation about this?


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 3.  RE: How to use checkAcl method in ServerAPI class

    Posted 04/02/09 11:24 AM

    Salut,

    Have you inverted the result ?
    I think case 1 should be Y and case 2 should be N

    and how do you test your case 2 ? with developer using the “monUser” account ?
    print the result of ‘InvokeState.getCurrentUser().getName();’ to be sure it is “monUser”.
    → It’s working fine with your example in my 6.5 IS. :slight_smile:


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB