Twitter
F.A.Q. - Permission

Category index

Commerce (3) Resources (21) Membership (8) Touch (3)
Registration (10) Invoice (5) Message (0) Defender (4)
Permission (7) Mass Mail (2) Analytics (1) File Manager (0)
Instructions (6) Miscellaneous (0)    


Permission component module - mod_jscacl_menu

mod_jscacl_menu module was developed to extend functionality of joomla mod_mainmenu module.
if you need hide menu links from user groups which have no permissions to access certain page then you just set permissions for certain menu link (url) in Mighty Permission component and use mod_jscacl_menu instead of mod_mainmenu module.


"Permissions" section

Permissions section contains a list of components permissions of which you can change. By default, the list has only few components, but you can modify the list by adding or deleting components(refer to Adding components to Permissions' list of components).

Clicking on one of the components in the list, takes you to a page with a table where names of the rows indicate the actions the component can do and columns’ names indicate existing user groups. The cells of the table are boxes which can be checked or unchecked. If the box is checked that means that the respective action is allowed to users of the respective user group.

For example, if you click the "Joomla Banners" component you will see a table the rows' names of which indicate actions possible to do with Banner component. All the boxes are ticked by default – each user can perform any action provided by the component.

Now, if you untick the box under ‘Registered’ column of the "Add a banner" row and under "Publisher" column of the "Remove banner(s)" row, users of "Registered" user group will not be able to add a banner and users of "Publisher" user group will not be able to remove banners.


Assigning Permission' user group to user

Each user that registers at your site via the front-end is associated with the user group specified in joomla--> Global Configuration-->System-->User Settings-->New User Registration Type.


In order to assign Permission user group to a user, you need to edit user details via User manager:

  1. Navigate to Site-->User Manager or Components-->Mighty Registration-->User Manager
  2. Select the user whose user group you want to change
  3. Click the ‘Edit’ button
  4. Select the group from the ‘Group’ list
  5. Save the changes

Note that you cannot change user group of more than 1 user at a time.


Adding components to "Permissions" section

Permission section lists components that you can set permissions for.  By default there are only few components listed. You can add components to the list or delete them. To add a component take the following steps:

  1. Navigate to Mighty Permission->Permissions
  2. Click the ‘New’ button
  3. Enter some name into the ‘Name of the file’ field. This name will be used for the xml file that will be created for the component
  4. Enter some name into the ‘Name’ field. This name will indicate the component in the Permissions section.
  5. Enter com_component into the ‘option(com_something)’ field. Com_component must be replaced by whatever wording that goes after the ‘option=’ in the URL to the component.
    For example, com_juser, com_resource, com_content,  etc
  6. The rest of the fields can be left empty, but you can fill them in if needed.
  7. Save the changes made.

Setting permissions for a specific user

To be able to set permissions for a specific user, install Mighty Registration.

1) Navigate to Mighty Registration-> User Manager.

2) Tick a user you want to set the permissions for. 

3) Click on the ‘Set Permissions’ button.

4) In the appeared window click on the component you want to change user’s permissions for. 

5) Check the box if you want the user to be able to perform the respective action;

    Uncheck the box if you do not want the user to be able to perform the respective action.


Creating a new user group in Permission.

To create a new user group in Mighty Permission, do the following:

1) Navigate to Mighty Permissions-> User Groups

2) Click the ‘Add’ button

3) In the appeared pop-up window enter the name for the new user group and select a group the new one should be based on.

 

The newly created user group has the same permissions as the one it is based on, but you can change the permissions in the Permissions section of the component.


How can I create XML for other components?

In this tutorial I’m going to show you how to write your own XML component description files for Mighty Permission Component. The main purpose of the XML file here is to specify the set of actions for desired component that you are going to set permissions for.

Before I start to explain you how to create XML file let me explain how Mighty Permission works in general. If you understand that, then you do not need to understand what is XML file for and how to manage but simple to learn XML syntax.
First you need to understand Mighty Permision URL based ACL. What does that mean? Let me show an example. Say, you have URL http://yoursite.com/index.php?option=com_content&view=article&task=add_comment&... This URL submits comment to the article. Mighty Permission can say Joomla “Please, do not allow this user or user group to access any URL where task = add_comment in com_content component”.

But for Mighty Permission to tell Joomla this, it must know that this variation exists. That is what XML files stand for. For example, to help JS Permission to know that we want to manage variation I described above, simple add to XML line

<variable task=”add_comment”>Add Comment</variable>

That is it. And even more. Imagine you want to restrict only adding comments to article ID 123. Then create line

<variable task=”add_comment” article=”123>
Add Comment to my favorite article</variable>

Another example on managing publish ability.

<variable task=”publish”> Publish</variable>

This is general publish task. But what if our component has 2 sections like say category manager and item manager and task=publish in both section but you want manage publish ability in every section separately?

<variable task=”publish” controller=”category”> Publish category</variable>
<variable task=”publish” controller=”item”> Publish Item</variable>

Just look into URL and you will intuitively understand what you need to add.

You will ask, where is the component option? Every Joomla URL or post request has option parameter. And value of this parameter is a name of the component that will handle this URL.
You do not need to set component option in XML. You will create different XML for each component and set component name in <component> tag like this <component option='com_example'>

So here is the flow. When any Joomla page is requested, Mighty Permission plugin detect what component will handle this URL, then JS Permission plugin look through all XML files on your site and if do not find just allows to go through and if find it look inside all URL variations listed and if match anything see if this user can do that or not and as a result return user on previous page or grand an access.

Ok, now let me show you whole file and explain you more details.

<?xml version="1.0" encoding="utf-8"?>
 <component option='com_categories'>
   <name>Joomla Categories</name>
   <author>joomSuite</author>
   <version>1.0</version>
   <email>support@mightyextensions.com</email>
   <site>http://www.joomosuite.com</site>
   <license>Comemrcial</license>
   <copyright>JoomSuite</copyright>
   <description>This XML Document is made to 
     manage permissions for Joomla Categories</description>
   <group name='Weblinks Categories Management'>
     <variable section='com_weblinks' task='add'>Add a Category</variable>
     <variable section='com_weblinks' task='remove'>Remove a Category</variable>
     <variable section='com_weblinks' task='edit'>Edit a Category</variable>
     <variable section='com_weblinks' 
       task='publish'>Publish a Category(ies)</variable>
     <variable section='com_weblinks' 
       task='unpublish'>Unpublish a Category(ies)</variable>
   </group>
   <group name='Contacts Categories Management'>
     <variable section='com_contact' task='add'>Add a Category</variable>
     <variable section='com_contact' task='remove'>Remove a Category</variable>
     <variable section='com_contact' task='edit'>Edit a Category</variable>
     <variable section='com_contact' 
       task='publish'>Publish a Category(ies)</variable>
     <variable section='com_contact' 
       task='unpublish'>Unpublish a Category(ies)</variable>
   </group>
 </component>

I deleted some groups from it because it is too long. You XML should always start with <?xml version="1.0" encoding="utf-8"?>.
All other XML tags should be inside <component> tag and <component> tag should have option attribute that is equal to component name.

<name>Example</name> - is the name of your configuration. Not necessary it to be equal to component name.
<author>John Doe</author> - the name of the author (your name)
<version>1.0</version> - XML version
<email>krik123@bk.ru</email> - author email in case to ask questions
<site>http://www.joomlaequipment.com</site> - Author website may be to look for updates
<license>Freeware</license> - License type
<copyright>JoomSuite</copyright> - Copyright
<description>This XML Document is made to manage permissions for Articles</description> - description means description

By using <group> and </group> tags you can divide all action according to groups for your comfort, for example you have a component with many section like Virtuemart. You can group your actions like this

  • Products
    • Add new
    • Publish
    • Unpublish
    • Delete
    • Edit
    • Add price
  • Categories
    • Add new
    • Publish
    • Unpublish
    • Delete
    • Edit
  • Orders
    • Add new
    • Publish
    • Unpublish
    • Delete
    • Edit
  • Shipping
    • Add Method
    • Delete Methos

Then on set permission page it will be easier to find required action. But it is optional and you can just write one group and write all the actions in one group.

So, now I hope you’ll be able to write your own XML files for JS Permission component.
Thanks for your attention and have a good day.


What is best way for Download/Installation MightyExtensions?
 


Member Area



Member Activity

We have 1137 guests and 8 members online


MightyTemplate - Professional Joomla Templates