5 Replies Latest reply on Mar 31, 2002 12:04 AM by echofloripa

    how to restrict user interface

    echofloripa

      how to restrict user interface as hidding some option in the JSP page depending on the user rights on the methods permissions deployed on the EJB container (ejb-jar.xml)

      Thanks in advance

      Emerson cargnin

        • 1. Re: how to restrict user interface
          echofloripa

          the problem is that when you configure the permissions on the EJB in a declarative way the web layer doesn't have a way to know which methods are available in the ejb...

          Please, I need some ideas

          Regards
          Emerson Cargnin

          • 2. Re: how to restrict user interface
            joe543

            Hi,

            Is your webapp mvc based?

            If your web app adheres to the MVC design pattern, your jsp should show an uptodate view based on the results of a model update/change or the current state of the model.

            Can you clarify your question a bit more please. What in the view are you trying to restrict access to?

            Joe

            • 3. Re: how to restrict user interface
              echofloripa

              some users have access to some options that other doesn't.
              But the place where this permissions are configured is in the ejb-jar.xml. How to make the JSP (or tag ligs) know what shoul'd be shown without trying to make a remote call and be allowed or not?????

              Emerson

              • 4. Re: how to restrict user interface
                clarance

                What I did was create another method in the interface that had the same permissions but did nothing. Then you can call this mehtod to determine if you can do what you want to do.

                For example, lets say I have the createUser method. I create a second method hasCreateUserPermission. In the JSP (I use a tag) I call the hasCreateUserPermission and if I can execute this then I know that I can put the createUser into the interface.

                Note: I am using XDoclet so I use it to put these extra methods into the interface.

                • 5. Re: how to restrict user interface
                  echofloripa

                  A very good solution (the kind of : how haven´t I ever thought of that : ))
                  Can you send some example?? (of XDocLet file too)

                  Regads
                  Emerson