[Building Sakai] SAKAI_REALM_FUNCTION

Glenn R. Golden ggolden22 at mac.com
Tue Aug 23 09:26:03 PDT 2011


Paul -

It has been a while, but I think this works as follows:

The expectation is that the registration occurs at the init of your code, every time - I don't bother to check, I just have code like this in the service impl's init() method:

	public void init()
	{
		try
		{
			// register functions
			functionManager.registerFunction(GRADE_PERMISSION);
			functionManager.registerFunction(GUEST_PERMISSION);
					...

This makes sure the function is available to the authz service.

I think that you will start to see entries in the database once you have assigned the function to a role in a site.  When the authz group is saved (DbAuthGroupService.java save()) it checks all the functions it needs with checkFunctionName(), which is where they get inserted in the db for the first time, and by that insert, allocated a number.  The number is what gets stored with the authz.

Again, this is old knowledge based on the original code.  You can check these files in their current state in your version to see if the same holds true.  Just scan your java code for the place where:

insert into SAKAI_REALM_FUNCTION

is found.

- Glenn

Glenn R. Golden
Chief Architect, Etudes, Inc.
ggolden at etudes.org


On Aug 23, 2011, at 12:06 PM, Paul Mungai wrote:

> How do I add functions to the table SAKAI_REALM_FUNCTION.
> 
> This was my attempt. Its stored in memory, and once the server restarts, data is lost.
> 
> import org.sakaiproject.authz.cover.FunctionManager;
> 
> private FunctionManager functionManager;
> 
> 
> if (!currentFunctions.contains(CourseCreatorFunctions.COURSECREATOR_FUNCTION_INSTRUCTOR_ADDMEMBER))
>                 functionManager.registerFunction(CourseCreatorFunctions.COURSECREATOR_FUNCTION_INSTRUCTOR_ADDMEMBER, true);
> 
> 
> -- 
> Regards,
> Paul Mungai
> 
> "Ability is what youre capable of doing. Motivation determines what you do. Attitude determines how well you do it" By Lou Holtz, Notre Dame Football Coach
> _______________________________________________
> 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"

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20110823/9c9d1e4b/attachment.html 


More information about the sakai-dev mailing list