I want to customize Surf Platform Root-Scoped API specifically user object. That means add new property or method to user object to check the user is in certain group in header.inc.ftl [in share] like `<#if user.isAdmin>
- How can I implement this?
- Is Alfresco Root Scoped Objects can be used as Surf Platform Root-Scoped object?
I have no idea of customizing surf platform root object. Can anyone help me???
Not quite sure what you are trying to accomplish, but the role security model is hardcoded in spring-surf/spring webscripts. There is guest, user and admin. If what you want is another analogous role you’ll have to hack the spring-surf libaries, namely:
This is what I had to do to implement
user.isEmployee. This approach allows you to literally treat your new role just as the others.you can use
in page descriptors or
on the navigation.
Just checking whether the user is in a certain group in a certain webscript is a whole diffrent story and does not provide the same functionality.
If what you want is the latter, you should make a call to
miss
and works through the response.
Update: The item permission attribute requires a little more tweaking.
In
header.get.js, propagate the new role to it gets processed properly inheader.inc.ftl: