voyent
Is this a bug?  XML
Forum Index -> General Help
Author Message
sjmenden

Joined: 04/Dec/2006 00:00:00
Messages: 5
Offline


The administration subview still gets shown even though the admin variable is false, and no exceptions get thrown

index.xhtml
Code:
 ...
 <!-- Administration -->
 <f:subview rendered="#{login.admin == true}">
 <li>
 	<li><a href="administration.seam">Administration</a></li>
 	<ul>
 		<li>
 			<strong>
 				<a href="user.seam">New User</a>
 			</strong>
 		</li>
 		<li>
 			<strong>
 				<s:link id="viewUsers" value="View Users" propagation="end" action="#{viewUsers.findFirstPage}"/>
 			</strong>
 		</li>
 		<li>
 			<strong>
 				<a href="role.seam">New Role</a>
 			</strong>
 		</li>
 		<li>
 			<strong>
 				<s:link id="viewRoles" value="View Roles" propagation="end" action="#{viewRoles.findFirstPage}"/>
 			</strong>
 		</li>
 	</ul>
 </li>
 </f:subview>
 ...
 




Backing EJB3: LoginAction.java
Code:
 ....
 //Base case
 if(Contexts.getSessionContext().get("currentUser") == null) {
 	log.info("Returning false for isAdmin because currentUser == null");
 	return false;
 }
 
 try {
 	User user = (User)Contexts.getSessionContext().get("currentUser");
 	for(Role r : user.getRoles()) {
 		if(r.getRole().equals("admin")) {
 			log.info("Returning true for isAdmin because no admin role was found");
 			return true;
 		}
 	}
 } catch(Exception e) {
 	log.error(e.getMessage());
 	log.error("Error executing isUserAdmin, most likely due the User being null because no User is on the session(user not logged in).");
 }
 log.info("Returning false for isAdmin as a last resort");
 return false;
 ....
 




Console output:
Code:
 Returning false for isAdmin because currentUser == null
 





And even though the admin variable resolves to false, the subview is still getting displayed, how can this be? I've been beating my head over the wall for several days now to no avail. This only happens when I replace the set of seam jars with the ICEfaces jars. And the ICEfaces components do work, just the Expression language is messed up in this case and a few others.

 
Forum Index -> General Help
Go to:   
Powered by JForum 2.1.7ice © JForum Team