Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I believe what you are trying to do is not supported by Joomla. My suggestion is to add a custom rule for views in access.xml </p> <pre><code>&lt;section name="component"&gt; &lt;action name="core.admin" title="JACTION_ADMIN" description="JACTION_ADMIN_COMPONENT_DESC" /&gt; &lt;action name="core.manage" title="JACTION_MANAGE" description="JACTION_MANAGE_COMPONENT_DESC" /&gt; &lt;action name="core.create" title="JACTION_CREATE" description="JACTION_CREATE_COMPONENT_DESC" /&gt; &lt;action name="core.delete" title="JACTION_DELETE" description="JACTION_DELETE_COMPONENT_DESC" /&gt; &lt;action name="core.edit" title="JACTION_EDIT" description="JACTION_EDIT_COMPONENT_DESC" /&gt; &lt;action name="core.edit.state" title="JACTION_EDITSTATE" description="COM_CATEGORIES_ACCESS_EDITSTATE_DESC" /&gt; &lt;/section&gt; &lt;section name="views"&gt; &lt;action name="core.admin" title="JACTION_ADMIN" description="JACTION_ADMIN_COMPONENT_DESC" /&gt; &lt;/section&gt; </code></pre> <p>Then save your view in the <code>#__assets</code> table with a name like <code>com_component.view.playerlist</code>, in the <code>rules</code> field you should save a JSON encoded list of your rules:</p> <pre><code>{"core.admin":{}} </code></pre> <p>You can check if current user can or cannot access a determinate section using <code>JAccess</code></p> <pre><code>$user_id=JFactory::getUser()-&gt;id; $has_permission = JAccess::check($user_id,'core.admin','com_component.view.playerlist'); if($has_permission){ draw_view(); }else{ JError::riseError(403,JText::_('PERMISSION_DENIED')); // or JError::raiseWarning(403,JText::_('PERMISSION_DENIED')); } </code></pre> <p>If you have any doubt, feel free to comment.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload