Commit 66344b41 by Tuukka Kivilahti

some nice examble

1 parent d8809b16
...@@ -17,8 +17,9 @@ ...@@ -17,8 +17,9 @@
<composite:implementation> <composite:implementation>
<h:form> <h:form>
<c:choose>
<c:when test='#{sessionHandler.hasPermission("userList", "read") }' >
<h:dataTable border="1" id="user" value="#{userView.users}" var="user"> <h:dataTable border="1" id="user" value="#{userView.users}" var="user">
<h:column> <h:column>
<f:facet name="header"> <f:facet name="header">
...@@ -69,10 +70,20 @@ ...@@ -69,10 +70,20 @@
<h:commandButton action="#{userView.edit()}" value="Edit" /> <h:commandButton action="#{userView.edit()}" value="Edit" />
</h:column> </h:column>
</h:dataTable> </h:dataTable>
</c:when>
<c:otherwise>
TODO: some nice message to user.
</c:otherwise>
</c:choose>
</h:form> </h:form>
</composite:implementation> </composite:implementation>
</html> </html>
...@@ -18,7 +18,7 @@ import fi.insomnia.bortal.model.User; ...@@ -18,7 +18,7 @@ import fi.insomnia.bortal.model.User;
* *
* @author tuukka * @author tuukka
*/ */
@ManagedBean(name = "SessionHandler") @ManagedBean(name = "sessionHandler")
@SessionScoped @SessionScoped
public class SessionHandler { public class SessionHandler {
...@@ -43,8 +43,8 @@ public class SessionHandler { ...@@ -43,8 +43,8 @@ public class SessionHandler {
} }
public boolean hasPermission(String target, RolePermission permission) { public boolean hasPermission(String target, RolePermission permission) {
return false;
return handlerbean.hasPermission(target, getUser(), permission); //return handlerbean.hasPermission(target, getUser(), permission);
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!