From 1cfd479ad1508ba5dc66b40dafdb4f55adb7fc7d Mon Sep 17 00:00:00 2001 From: lishengzhao Date: Wed, 30 Jul 2014 14:44:11 +0800 Subject: [PATCH] Upgrade codes --- src/main/java/cc/wdcy/domain/shared/GuidGenerator.java | 7 +++++++ .../cc/wdcy/domain/shared/security/WdcyUserDetails.java | 2 +- .../java/cc/wdcy/web/oauth/OauthUserApprovalHandler.java | 2 +- src/main/webapp/WEB-INF/jsp/mobile/dashboard.jsp | 2 +- src/main/webapp/WEB-INF/jsp/unity/dashboard.jsp | 2 +- src/main/webapp/WEB-INF/jsp/user_overview.jsp | 2 +- src/main/webapp/index.jsp | 2 +- src/main/webapp/login.jsp | 2 +- 8 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/main/java/cc/wdcy/domain/shared/GuidGenerator.java b/src/main/java/cc/wdcy/domain/shared/GuidGenerator.java index 6d55f72..35307af 100644 --- a/src/main/java/cc/wdcy/domain/shared/GuidGenerator.java +++ b/src/main/java/cc/wdcy/domain/shared/GuidGenerator.java @@ -7,6 +7,13 @@ import java.util.UUID; */ public abstract class GuidGenerator { + + /** + * private constructor + */ + private GuidGenerator() { + } + public static String generate() { return UUID.randomUUID().toString().replaceAll("-", ""); } diff --git a/src/main/java/cc/wdcy/domain/shared/security/WdcyUserDetails.java b/src/main/java/cc/wdcy/domain/shared/security/WdcyUserDetails.java index f143a4e..3f22e2a 100644 --- a/src/main/java/cc/wdcy/domain/shared/security/WdcyUserDetails.java +++ b/src/main/java/cc/wdcy/domain/shared/security/WdcyUserDetails.java @@ -33,7 +33,7 @@ public class WdcyUserDetails implements UserDetails { * @return Collection of GrantedAuthority */ @Override - public Collection getAuthorities() { + public Collection getAuthorities() { return Arrays.asList(DEFAULT_USER_ROLE, new SimpleGrantedAuthority(ROLE_PREFIX + "UNITY"), new SimpleGrantedAuthority(ROLE_PREFIX + "MOBILE")); } diff --git a/src/main/java/cc/wdcy/web/oauth/OauthUserApprovalHandler.java b/src/main/java/cc/wdcy/web/oauth/OauthUserApprovalHandler.java index f77e567..236d657 100644 --- a/src/main/java/cc/wdcy/web/oauth/OauthUserApprovalHandler.java +++ b/src/main/java/cc/wdcy/web/oauth/OauthUserApprovalHandler.java @@ -26,7 +26,7 @@ public class OauthUserApprovalHandler extends TokenServicesUserApprovalHandler { } OauthClientDetails clientDetails = oauthService.loadOauthClientDetails(authorizationRequest.getClientId()); - return (clientDetails != null && clientDetails.trusted()); + return clientDetails != null && clientDetails.trusted(); } diff --git a/src/main/webapp/WEB-INF/jsp/mobile/dashboard.jsp b/src/main/webapp/WEB-INF/jsp/mobile/dashboard.jsp index dbdac42..3ad2bf4 100644 --- a/src/main/webapp/WEB-INF/jsp/mobile/dashboard.jsp +++ b/src/main/webapp/WEB-INF/jsp/mobile/dashboard.jsp @@ -10,6 +10,6 @@ Mobile dashboard -

Hi Mobile.

+

Hi Mobile.

\ No newline at end of file diff --git a/src/main/webapp/WEB-INF/jsp/unity/dashboard.jsp b/src/main/webapp/WEB-INF/jsp/unity/dashboard.jsp index 1dccc70..46602c2 100644 --- a/src/main/webapp/WEB-INF/jsp/unity/dashboard.jsp +++ b/src/main/webapp/WEB-INF/jsp/unity/dashboard.jsp @@ -10,6 +10,6 @@ Unity dashboard -

Hi Unity.

+

Hi Unity.

\ No newline at end of file diff --git a/src/main/webapp/WEB-INF/jsp/user_overview.jsp b/src/main/webapp/WEB-INF/jsp/user_overview.jsp index d534fb4..cc53851 100644 --- a/src/main/webapp/WEB-INF/jsp/user_overview.jsp +++ b/src/main/webapp/WEB-INF/jsp/user_overview.jsp @@ -10,6 +10,6 @@ User Overview -

User Overview

+

User Overview

\ No newline at end of file diff --git a/src/main/webapp/index.jsp b/src/main/webapp/index.jsp index 38d4aac..b0c92db 100644 --- a/src/main/webapp/index.jsp +++ b/src/main/webapp/index.jsp @@ -10,7 +10,7 @@ Home -

spring-oauth is work!

+

spring-oauth is work!

Logout diff --git a/src/main/webapp/login.jsp b/src/main/webapp/login.jsp index c08f820..aa740fe 100644 --- a/src/main/webapp/login.jsp +++ b/src/main/webapp/login.jsp @@ -10,7 +10,7 @@ Oauth login -

Oauth login

+

Oauth login