[Building Sakai] How to add tool function options to realms like site.add
Anthony Whyte
arwhyte at umich.edu
Tue Apr 19 06:31:19 PDT 2011
Do something like this in your init() method:
rwiki: https://source.sakaiproject.org/svn/rwiki/trunk/rwiki-impl/impl/src/java/uk/ac/cam/caret/sakai/rwiki/component/service/impl/RWikiSecurityServiceImpl.java
List l = functionManager.getRegisteredFunctions("rwiki.");
if (!l.contains(SECURE_READ))
functionManager.registerFunction(SECURE_READ);
if (!l.contains(SECURE_UPDATE))
functionManager.registerFunction(SECURE_UPDATE);
if (!l.contains(SECURE_CREATE))
functionManager.registerFunction(SECURE_CREATE);
if (!l.contains(SECURE_SUPER_ADMIN))
functionManager.registerFunction(SECURE_SUPER_ADMIN);
if (!l.contains(SECURE_ADMIN))
functionManager.registerFunction(SECURE_ADMIN);
Plenty of examples exist in the code. For example, see:
kernel: https://source.sakaiproject.org/svn/kernel/trunk/kernel-impl/src/main/java/org/sakaiproject/content/impl/BaseContentService.java
msgcntr: https://source.sakaiproject.org/svn/msgcntr/trunk/messageforums-component-impl/src/java/org/sakaiproject/component/app/messageforums/DefaultPermissionsManagerImpl.java
Cheers,
Anthony
On Apr 18, 2011, at 10:49 PM, Steve Swinsburg wrote:
> Hi Michael,
> You can register the list of functions with the security manager. If you wire up your code with spring and define an init method, you can put it in there.
>
> Cheers
>
> Sent from my iPhone
>
> On 19/04/2011, at 1:59, "Jennings, Michael" <mike_jennings at unc.edu> wrote:
>
>> I am creating a new tool and would like to have a new function added to the list of security relams functions. Is there some code that I can use as a example or documentation.
>>
>>
>>
>> Thanks,
>>
>>
>>
>> Mike
>>
>>
>>
>> ==============================================================================
>>
>> Mike Jennings
>>
>> Teaching and Learning Developer
>>
>> University of North Carolina at Chapel Hill
>>
>>
>>
>> Office: (919) 843-5013
>>
>> Cell: (919) 442-8337
>>
>> E-mail: mike_jennings at unc.edu
>>
>>
>>
>> _______________________________________________
>> 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"
> _______________________________________________
> 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/20110419/b06185be/attachment.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3829 bytes
Desc: not available
Url : http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20110419/b06185be/attachment.bin
More information about the sakai-dev
mailing list