简体   繁体   English

如何让经理看到joomla 2.5组件?

[英]how to allow manager to see a component joomla 2.5?

I'm creating a new joomla component. 我正在创建一个新的joomla组件。

I've compressed the component in a zip file and installed it, everything works fine and I can see the component in components menu (in the back-end off-course) in when I log in as super user. 我已经将组件压缩到一个zip文件中并安装了它,一切正常,当我以超级用户身份登录时,可以在组件菜单(后端后端)中看到该组件。 the problem is when I log in as a manger I can't see the component in that menu, nevertheless I can access it if I point my browser directly to the component url. 问题是当我以管理者身份登录时,在该菜单中看不到该组件,但是,如果我将浏览器直接指向组件url,则可以访问它。

It's a very simple component (no config or access.xml) I just want both mangers and super user to see the component in the menu. 这是一个非常简单的组件(没有config或access.xml),我只希望管理者和超级用户都可以在菜单中看到该组件。

In config.xml you'll have to add this- 在config.xml中,您必须添加以下内容-

<fieldset
        name="permissions"
        label="JCONFIG_PERMISSIONS_LABEL"
        description="JCONFIG_PERMISSIONS_DESC"
        >

        <field
            name="rules"
            type="rules"
            label="JCONFIG_PERMISSIONS_LABEL"
            class="inputbox"
            filter="rules"
            validate="rules"
            component="com_component"
            section="component" />
    </fieldset>

And there will an access.xml file - 并且会有一个access.xml文件-

<?xml version="1.0" encoding="utf-8"?>
<access component="com_component">
    <section name="component">
        <action name="core.admin" title="JACTION_ADMIN" description="JACTION_ADMIN_COMPONENT_DESC" />
        <action name="core.manage" title="JACTION_MANAGE" description="JACTION_MANAGE_COMPONENT_DESC" />
        <action name="core.create" title="JACTION_CREATE" description="JACTION_CREATE_COMPONENT_DESC" />
        <action name="core.delete" title="JACTION_DELETE" description="JACTION_DELETE_COMPONENT_DESC" />
        <action name="core.edit" title="JACTION_EDIT" description="JACTION_EDIT_COMPONENT_DESC" />
        <action name="core.edit.state" title="JACTION_EDITSTATE" description="JACTION_EDITSTATE_COMPONENT_DESC" />
    </section>
    <section name="category">
        <action name="core.create" title="JACTION_CREATE" description="COM_CATEGORIES_ACCESS_CREATE_DESC" />
        <action name="core.delete" title="JACTION_DELETE" description="COM_CATEGORIES_ACCESS_DELETE_DESC" />
        <action name="core.edit" title="JACTION_EDIT" description="COM_CATEGORIES_ACCESS_EDIT_DESC" />
        <action name="core.edit.state" title="JACTION_EDITSTATE" description="COM_CATEGORIES_ACCESS_EDITSTATE_DESC" />
    </section>
</access>

Read more- http://docs.joomla.org/Adding_ACL_rules_to_your_component 阅读更多-http: //docs.joomla.org/Adding_ACL_rules_to_your_component

Hope this will help. 希望这会有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM