[Building Sakai] About the content tool and the permissions helper tool

Jim Eng jimeng at umich.edu
Wed Apr 8 10:57:43 PDT 2009


Hi Glauber,

Since 2.5.0, the permission helper has been launched in response to  
the user invoking a  
org.sakaiproject.content.types.FolderType.FolderPermissionsAction with  
respect to a particular folder.  The FolderPermissionsAction  
implements the InteractionAction interface, which defines a pair of  
methods that might be what you are looking for:

	/**
	  
*ResourcesActioncallsthismethodbeforestartingthehelper 
.Thisisintendedtogive
	  
*theregistrantachancetodoanypreparationneededbeforethehelperstartswithrespect
	  
*tothisactionandthereferencespecifiedintheparameter 
.ThemethodreturnsaString
	  
*(possiblynull 
)whichwillbeprovidedasthe"initializationId"parametertoother
	 *methodsandin
	 *@paramreference
	 *@return
	 */
	public String initializeAction(Reference reference);
	
	/**
	 *ResourcesActioncallsthismethodaftercompletionofitsportionoftheaction.
	 *@paramreferenceThe
	 *@paraminitializationId
	 */
	public void finalizeAction(Reference reference, String  
initializationId);

	/**
	  
*ResourcesActioncallsthismethodiftheusercancelsoutoftheactionorsomeerror
	  
*occurspreventingcompletionoftheactionafterthehelpercompletesitspartofthe
	 *action.
	 *@paramreference
	 *@paraminitializationId
	 */
	public void cancelAction(Reference reference, String initializationId);
	
The point is that initializeAction() is called before the permissions  
helper is launched and either finalizeAction() or cancelAction() is  
called when the helper is done.  Those would be the places where you  
could participate in the activity of the helper.

HTH.

Jim



On Apr 8, 2009, at 9:27 AM, Glauber Cabral wrote:

> Dear Sakai devs.
>
> This is my first message to the list and I'm developing using  
> sakai2.4.
> I need to execute an action when folder permissions are changed in the
> Content tool.
> As I could see, it uses the permissions.helper tool from authz tool..
>
> I tried to overwrite ToolServlet.sendToHelper inside ResourcesAction
> to get permissions before and after the execution of the helper tool.
> The problem in this function is that it is called 2 or 3 times before
> getting into the helper and 2 or 3 times after leaving the helper and
> i could not see any difference in the request and response parameters.
>
> The other method I tried working on was the  
> ResourcesActions.doDispatchAction().
> Inside this method there is a call to ToolServlet.startHelper(). So I
> tried to get existing permissions before and after this function call.
> The problem is that the call returns immediately after setting the
> helper tool and not after leaving the helper tool.
>
> I could not find where (inside Content tool) the return from the
> helper tool is treated to get the permissions in this place.
>
> Do you have any suggestions about which method should I overwrite? Is
> there such a service in another sakai tool that I could use?
> I need to code the action inside Content tool.
>
> Thank you a lot for your attention.
>
> Glauber Cabral
> _______________________________________________
> sakai-dev mailing list
> sakai-dev at collab.sakaiproject.org
> http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
>
> TO UNSUBSCRIBE: send email to sakai-dev-unsubscribe at collab.sakaiproject.org 
>  with a subject of "unsubscribe"
>
>



More information about the sakai-dev mailing list