let users visit home page without logging in

pull/263/head
Justin Richer 2012-12-18 13:56:46 -05:00
parent f265347311
commit 87788f0710
4 changed files with 32 additions and 20 deletions

View File

@ -29,7 +29,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
*/
@Controller
@PreAuthorize("hasRole('ROLE_USER')") // TODO: this probably shouldn't be here
public class ManagerController {
@Autowired
@ -45,6 +44,7 @@ public class ManagerController {
return "home";
}
@PreAuthorize("hasRole('ROLE_USER')") // TODO: this probably shouldn't be here
@RequestMapping("manage/**")
public String showClientManager() {
// TODO: move view

View File

@ -1,9 +1,11 @@
<%@ taglib prefix="security" uri="http://www.springframework.org/security/tags" %>
<div class="span2">
<security:authorize access="hasRole('ROLE_USER')">
<div class="well sidebar-nav">
<ul class="nav nav-list">
<security:authorize ifAnyGranted="ROLE_ADMIN">
<security:authorize access="hasRole('ROLE_ADMIN')">
<li class="nav-header">Administrative</li>
<li><a href="manage/#admin/clients">Manage Clients</a></li>
<li><a href="manage/#admin/whitelists">Whitelisted Clients</a></li>
@ -15,4 +17,12 @@
<li><a href="manage/#user/profile">Manage Profiles</a></li>
</ul>
</div><!--/.well -->
</security:authorize>
<security:authorize access="!hasRole('ROLE_USER')">
<div class="well">
<div>You are not logged in.</div>
<hr />
<div class="row-fluid"><a class="btn btn-primary span12" href="j_spring_security_check"><i class="icon-user icon-white"></i> Log in</a></div>
</div>
</security:authorize>
</div><!--/span-->

View File

@ -11,22 +11,26 @@
<a class="brand" style="padding-left: 35px" href="">OpenID Connect Server</a>
<div class="nav-collapse">
<ul class="nav">
<li class="active"><a href="#">Home</a></li>
<li class="active"><a href="">Home</a></li>
<li><a href="about">About</a></li>
<li><a href="stats">Statistics</a></li>
<li><a href="contact">Contact</a></li>
</ul>
<security:authentication property="authorities" var="roles"/>
<div class="btn-group pull-right">
<ul class="nav pull-right">
<security:authorize access="hasRole('ROLE_USER')">
<div class="btn-group">
<a class="btn btn-primary btn-mini" href=""><i class="icon-user icon-white"></i> ${ userInfo.preferredUsername }</a>
<a class="btn btn-primary btn-mini dropdown-toggle" data-toggle="dropdown" href=""><span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="j_spring_security_logout"><i class="icon-remove"></i> Log out</a></li>
</ul>
</security:authorize>
</div>
</security:authorize>
<security:authorize access="!hasRole('ROLE_USER')">
<a class="btn btn-primary btn-mini" href="j_spring_security_check"><i class="icon-user icon-white"></i> Log in</a>
</security:authorize>
</ul>
</div><!--/.nav-collapse -->
</div>
</div>

View File

@ -4,12 +4,10 @@
<o:header title="welcome"/>
<o:topbar/>
<div class="container<security:authorize ifAnyGranted="ROLE_USER">-fluid</security:authorize>">
<div class="row<security:authorize ifAnyGranted="ROLE_USER">-fluid</security:authorize>">
<security:authorize ifAnyGranted="ROLE_USER">
<div class="container-fluid">
<div class="row-fluid">
<o:sidebar/>
</security:authorize>
<div<security:authorize ifAnyGranted="ROLE_USER"> class="span10"</security:authorize>>
<div class="span10">
<!-- Main hero unit for a primary marketing message or call to action -->
<div class="hero-unit">
<h1>Welcome!</h1>
@ -22,7 +20,7 @@
<p><a class="btn btn-primary btn-large" href="http://openid.net/connect/">Learn more &raquo;</a></p>
</div>
<!-- Example row of columns -->
<div class="row<security:authorize ifAnyGranted="ROLE_USER">-fluid</security:authorize>">
<div class="row-fluid">
<div class="span6">
<h2>About</h2>
@ -41,7 +39,7 @@
</div>
<hr>
<!-- Example row of columns -->
<div class="row<security:authorize ifAnyGranted="ROLE_USER">-fluid</security:authorize>">
<div class="row-fluid">
<div class="span12">
<h2>Current Statistics</h2>
@ -53,7 +51,7 @@
</div>
</div>
<o:copyright/>
</div>
</div>
<o:copyright/>
<o:footer/>