Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
E
Ecsite
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
shoei.kanno
Ecsite
Commits
724a0b36
Commit
724a0b36
authored
Oct 17, 2020
by
keita.onoguchi
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'カート機能' into 'master'
カート機能途中 See merge request
!19
parents
a9e42fea
67e5977c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
2 deletions
+7
-2
pom.xml
pom.xml
+4
-0
LoginUser.java
src/main/java/com/example/service/LoginUser.java
+2
-2
index.html
src/main/resources/templates/index.html
+1
-0
No files found.
pom.xml
View file @
724a0b36
...
...
@@ -55,6 +55,10 @@
<artifactId>
spring-security-test
</artifactId>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.thymeleaf.extras
</groupId>
<artifactId>
thymeleaf-extras-springsecurity4
</artifactId>
</dependency>
</dependencies>
<build>
...
...
src/main/java/com/example/service/LoginUser.java
View file @
724a0b36
...
...
@@ -15,7 +15,7 @@ public class LoginUser extends org.springframework.security.core.userdetails.Use
private
final
User
user
;
public
LoginUser
(
User
user
){
super
(
user
.
getEmail
(),
user
.
getPassword
(),
AuthorityUtils
.
createAuthorityList
(
user
.
getRoles
()));
super
(
user
.
getEmail
(),
user
.
getPassword
(),
getAuthorities
(
user
.
getRoles
()));
this
.
user
=
user
;
}
...
...
@@ -24,7 +24,7 @@ public class LoginUser extends org.springframework.security.core.userdetails.Use
}
//ログイン権限、文字列変更
private
Collection
<
GrantedAuthority
>
getAuthorities
(
String
role
)
{
private
static
Collection
<
GrantedAuthority
>
getAuthorities
(
String
role
)
{
if
(
role
.
equals
(
"ADMIN"
))
{
return
AuthorityUtils
.
createAuthorityList
(
"ROLE_ADMIN"
,
"ROLE_GENERAL"
);
}
else
{
...
...
src/main/resources/templates/index.html
View file @
724a0b36
...
...
@@ -33,6 +33,7 @@
<div
class=
"col-md-6"
>
<div
class=
"header-top-menu"
>
<ul
class=
"nav nav-pills navbar-right"
>
<li><a
sec:authorize=
"hasRole('ROLE_ADMIN')"
th:href=
"@{/limited/admin/management}"
>
Management
</a></li>
<!-- 履歴ページへ遷移 -->
<li><a
th:href=
"@{/limited/log/{id}(id=${user.id})}"
>
My Purchase Log
</a></li>
<!-- カートページへ遷移 -->
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment