chkal/pf-issue-test — Issue #106: Action methods should return boolean values that control navigation
Author: chkal
Created: 2012-03-06 07:36:39+00:00
State: open

Originally filed by **christia...@gmail.com** on 2011-05-20T21:05:23

Google Code issue: http://code.google.com/p/prettyfaces/issues/detail?id=108

I would like to see a feature like

#{authentificationBean.isUserLoggedIn}
/login.xhtml

The action method then should return a boolean value or it shall throw an exception if the condition is not fulfilled. I don't know how the expressions are resolved but probably complex expressions can be made here like:

#{authBean.isUserLoggedIn and authBean.allowedTo(#{pageBean.pageName},#{pageBean.accessAction})}

This expression would for example check if the user is logged in and if the user is allowed to do the accessAction(e.g. read, update, etc.) on the page/module(e.g. user, group). If not, the alternative-view-id will be returned or he will be redirected.