1 Reply Latest reply on Sep 14, 2003 1:17 AM by Juha Lindfors

    Query method permission

    emild Newbie

      Is it possible to query jboss for the permissions the currently logged in user has for a certain method?

      The reason for this is that I want to write a swing based client app, where fields the user has read only access to are locked and fields the user has no access to are grayed out. So what I need is a way to check the permissions of methods programatically.

      Thanks in advance
      Emil

        • 1. Re: Query method permission
          Juha Lindfors Master

          The realm mapping interface (implemented by security manager) exposes method

          public boolean doesUserHaveRole(Principal principal, Set roleNames);

          if you know on the client side what role the client must have in order to access specific GUI part.

          Or you could build a simple stateless service that on the server side accesses the authorized subject via SecurityAssociation and returns the role names from the Subject's 'Roles' group.

          -- Juha