Joomla! Discussion Forums



It is currently Mon Nov 23, 2009 12:58 pm (All times are UTC )

 


Forum rules

Please submit all new Tips and Tricks to: http://docs.joomla.org/Category:Tips_and_tricks

This forum section will be closed and removed eventually.



Post new topic Reply to topic  [ 1 post ] 
Author Message
Posted: Tue Dec 18, 2007 3:07 pm 
User avatar
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Tue Oct 30, 2007 5:36 pm
Posts: 10
Location: CZ
Ahoy,

I am in the process of developping a series of components that all work together for one specific company,
so no complete publishing here.
I just want to add my two cents to the community that helps me so much in these forums.

First i created a component that supplies a form, in which the administrator can choose a user in a dropdown list,
and then a whole bunch of checkboxes to indicate the different acl levels for my components.
(one checkbox for 'add', one for 'edit', one for 'delete', and so on for every component)
The results are stored in a separate table in the joomla database.

Then I created a separate plugin that checks the id of a given user to the mentioned table,
and returns an acl list.

In the default form that generates a list of documents in my components I added a line at the top;
$aclresults = $mainframe->triggerEvent( 'onaclcheck');
which triggers the plugin to return the acllist into an array in that form.
With that array the users' acl for the documents in the components' documentlist can be calculated,
and if applicable, it shows an 'edit' link in front of the document(s), an 'Add'button at the top, etc.

The whole system still uses the security that is build into the great framework,
but allows me to give permissions the way I want it to my components.

Downside to this approach is the databse call everytime a list of documents is asked for,
so I'm trying to get this into $mainframe variables, but for now this works.

By working with separate components and plugins that work together like this, it's easy
to maintain and expand the whole project while going live in the meantime.

Hope this helps someone on the way to develop something similar.

Bert


Top
  E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

Quick reply

 



Who is online

Users browsing this forum: No registered users and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group