toolbar menu API (was Re: [Yanel-dev] Re: [Yanel-commits] rev 45010
- public/yanel/trunk/src/webapp/src/java/org/wyona/yanel/servlet/menu)
Guillaume Déflache
guillaume.deflache at wyona.com
Thu Oct 15 10:05:30 CEST 2009
Michael Wechner schrieb:
> Guillaume Déflache schrieb:
>> Michael Wechner schrieb:
>>> Guillaume Déflache schrieb:
>>>> michi at wyona.com schrieb:
>>>>> [...]
>>>>
>>>> Maybe some helpers could, well, help there, like:
>>>>
>>>> protected final boolean mayBeViewed(String URI) {
>>>> PolicyManager pm = resource.getRealm().getPolicyManager();
>>>> return pm.authorize(URI,
>>>> resource.getEnvironment().getIdentity(), new
>>>> org.wyona.security.core.api.Usecase("view")));
>>>> }
>>>>
>>>> That could be defined in Yanel's Menu base class.
>>>
>>> done, slightly different though. Please note this can rise
>>> performance/scalability issues and I think before we continue
>>> using this wildly we first need incremental Menus via Ajax
The thing anyway is we will need an API for this, copy-pasting menu
entries won't work anymore as we will have to handle them selectively /
on demand.
>> How so? Could you maybe add a rationale in the javadoc else indeed no
>> one will dare to use it and then we could as well not have added it! :/
>> Is getting the PolicyManager over and over the issue?
>
> no, I would say checking the policy is the issue. Apache Lenya had
> similar issues and I don't want us to go down the same path again re
> performance/scalability issues.
OK I remember now. Maybe you should explain that a bit more in the
comment or add a link to this thread before we (I) forget again what
it's all about.
So I guess the next thing we need for these issues is an "addEntry"
method that would for example allow us to decide globally (or at least
for each menu) if the 'isAuthorized' method you added ought to be called
or not (and then would be called later via AJAX for example).
Well and if each menu is only created on demand if it ever gets open by
the user (which is AFAICS almost possible with the current API), then we
do not even need much more API and this per-menu switch! :)
Also I think given the signatures of the different methos in the Menu
base class, maybe we should consider handing the Environment and the
Resource objects to the constructors and make them available via
protected getters.
> On the other hand we need to tackle it at some point and hence I
> consider this food for thought.
Neat! :)
More information about the Yanel-development
mailing list