File tree Expand file tree Collapse file tree
java/com/github/throyer/common/springboot/configurations
resources/templates/app/fragments Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1818import static org .springframework .http .HttpMethod .POST ;
1919import static org .springframework .security .config .http .SessionCreationPolicy .STATELESS ;
2020
21+ import java .util .List ;
2122import java .util .Optional ;
2223import java .util .stream .Stream ;
2324
@@ -80,7 +81,7 @@ protected void globalConfiguration(
8081 .passwordEncoder (ENCODER )
8182 .withUser (username )
8283 .password (ENCODER .encode (password ))
83- .authorities ("SWAGGER" );
84+ .authorities (List . of () );
8485 }
8586
8687
@@ -133,7 +134,7 @@ public SecurityFilterChain app(HttpSecurity http) throws Exception {
133134 .antMatchers (POST , "/app/register" , "/app/recovery/**" )
134135 .permitAll ()
135136 .anyRequest ()
136- .authenticated ( )
137+ .hasAuthority ( "USER" )
137138 .and ()
138139 .csrf ()
139140 .disable ()
Original file line number Diff line number Diff line change 55 < h5 class ="modal-title "> < i class ="fas fa-user-alt "> </ i > About me</ h5 >
66 < button type ="button " class ="btn-close " data-bs-dismiss ="modal " aria-label ="Close "> </ button >
77 </ div >
8- < div class ="modal-body py-0 " sec:authorize ="isAuthenticated( ) " th:object ="${#authentication.principal} ">
8+ < div class ="modal-body py-0 " sec:authorize ="hasAnyAuthority('USER', 'ADM' ) " th:object ="${#authentication.principal} ">
99 < p >
1010 < span class ="fs-3 "> Name: </ span >
11- < span class ="fs-5 fw-light " th:if =" *{name} " th: text ="*{name} "> </ span >
11+ < span class ="fs-5 fw-light " th:text ="*{name} "> </ span >
1212 </ p >
1313 < p >
1414 < span class ="fs-3 "> Roles: </ span >
Original file line number Diff line number Diff line change 6868 Show more
6969 </ a >
7070 < ul class ="dropdown-menu border-0 shadow bg-light animate slideIn " aria-labelledby ="show-more ">
71- < li >
71+ < li sec:authorize =" hasAnyAuthority('USER', 'ADM') " >
7272 < a href ="# " data-bs-toggle ="modal " data-bs-target ="#me " class ="dropdown-item ">
7373 < i class ="fas fa-user-circle "> </ i >
7474 Me
You can’t perform that action at this time.
0 commit comments