10 Replies Latest reply on Mar 1, 2005 5:42 AM by ncd

    Display module to all users

    pedrojosemartins

      I created a new module which shows "Hello World", but i can only see it in the modules menu when i'm logged in as admin. Here's the jboss-service.xml file:

      <?xml version="1.0" encoding="UTF-8"?>
      <server>
      <mbean
       code="org.jboss.nukes.addons.modules.empresas.EmpresasModule"
       name="nukes.modules:name=empresas"
       xmbean-dd=""
       xmbean-code="org.jboss.nukes.component.NukesMBean">
       <xmbean>
       <attribute name="Security">
       <security>
       <permission group="*" pattern="::" level="READ"/>
       </security>
       </attribute>
       <attribute name="Configuration">
       <module>
       <operation name="main" display-name="Hello" description="Display Hello World" image="" hint=""/>
       </module>
       </attribute>
       <depends>nukes.modules:name=core</depends>
       <attribute name="DisplayName">Hello module</attribute>
       <attribute name="Description">User module displaying Hello World</attribute>
       </xmbean>
      </mbean>
      </server>


      Is something in the security area wrong?

      Thanks,
      Pedro Martins

        • 1. Re: Display module to all users
          theute

          I think



          Should do it.

          But now it is probably stored in the database, you have to change this by going in the jmxconsole

          • 2. Re: Display module to all users
            pedrojosemartins

            ??? I think you forgot to paste something.

            • 3. Re: Display module to all users
              theute


              Sorry:

              <permission group="*" pattern="::" level="READ"/>


              • 4. Re: Display module to all users
                pedrojosemartins

                In the web console, in the appropriate module, in the security textfield,
                i write

                <secutiry> <permission group="*" pattern="::" level="READ"/> </security>


                When pressing the "Apply changes" button, i receive the following error:
                java.lang.IllegalArgumentException
                 at org.jboss.nukes.common.propertyeditor.XMLPropertyEditorSupport.setAsText(XMLPropertyEditorSupport.java:52)
                 at org.jboss.util.propertyeditor.PropertyEditors.convertValue(PropertyEditors.java:181)
                 at org.jboss.jmx.adaptor.control.Server.setAttributes(Server.java:169)
                 at org.jboss.jmx.adaptor.html.HtmlAdaptorServlet.updateAttributes(HtmlAdaptorServlet.java:215)
                 at org.jboss.jmx.adaptor.html.HtmlAdaptorServlet.processRequest(HtmlAdaptorServlet.java:77)
                 at org.jboss.jmx.adaptor.html.HtmlAdaptorServlet.doPost(HtmlAdaptorServlet.java:61)
                 at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
                 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

                ...

                • 5. Re: Display module to all users
                  pedrojosemartins

                  The last post had a syntax error, it was security, not secutiry. However, after changing that, despite not having any error, it doesn't show up. Do i have to make any changes in the mysql database?

                  • 6. Re: Display module to all users
                    theute

                    I'm sorry again, need some sleep:

                    You need to put the whole code, with the line i tried to change:

                    <?xml version="1.0" encoding="UTF-8"?>
                    <server>
                    <mbean
                     code="org.jboss.nukes.addons.modules.empresas.EmpresasModule"
                     name="nukes.modules:name=empresas"
                     xmbean-dd=""
                     xmbean-code="org.jboss.nukes.component.NukesMBean">
                     <xmbean>
                     <attribute name="Security">
                     <security>
                     <permission group="*" pattern=".*:.*:.*" level="READ"/>
                     </security>
                     </attribute>
                     <attribute name="Configuration">
                     <module>
                     <operation name="main" display-name="Hello" description="Display Hello World" image="" hint=""/>
                     </module>
                     </attribute>
                     <depends>nukes.modules:name=core</depends>
                     <attribute name="DisplayName">Hello module</attribute>
                     <attribute name="Description">User module displaying Hello World</attribute>
                     </xmbean>
                    </mbean>
                    </server>


                    • 7. Re: Display module to all users
                      theute

                      To be more precise, the whole code in the jboss-service.xml for next time you want to install it.

                      Otherwise just the security part in the jmx-console

                      • 8. Re: Display module to all users
                        pedrojosemartins

                        No, i still can't see it. I've undeployed it, redeployed it and it still doesn't show up. Strangely enough, i can access it through the url

                        http://localhost:8080/index.html?module=empresas

                        Any ideas on how to break this one? Thanks.

                        • 9. Re: Display module to all users
                          pedrojosemartins

                          As i said before, i can only see it as administrator. If i'm not logged in or logged as a regular user, it does not show up in the modules menu, BUT i can access them via url.

                          • 10. Re: Display module to all users
                            ncd

                             

                            "pedrojosemartins" wrote:
                            As i said before, i can only see it as administrator. If i'm not logged in or logged as a regular user, it does not show up in the modules menu, BUT i can access them via url.


                            Hi!

                            I had the same problem. I read the source and everything, but couldn't find anything.

                            Then I copied the code from the MenuBlock to my test module, and that displayed the menu right, but on the same page the menu didnt show my test module link. Then I tried to see what can be set in the Menu itself, and then I've found that each block/module on the page uses it's on permission settings (even related to other modules/blocks).

                            So I had to add this:
                            <permission group="*" level="READ" pattern="module:MyTestModule:main"/>
                            to the security of the Menu block, and then it shows it right.

                            If this is a feature to handle the permissions of a module in every block differently, then it is starnge, as this way we can pretty easily loose track of permissions, and at the moment I don't see too much of advantage of it.

                            I hope I could help with this to a lot of people, who strugle with this as I did.