November 2017
Intermediate to advanced
542 pages
14h 24m
English
You may have noticed that there is no indication if a user is an administrator or a regular user. The next file specifies a direct mapping of the user to the corresponding authorities. If a user did not have an authority mapped to it, Spring Security would not allow that user to be logged in:
//src/main/resources/database/h2/security-user-authorities.sql insert into authorities(username,authority) values ('user1@example.com','ROLE_USER'); insert into authorities(username,authority) values ('admin1@example.com','ROLE_ADMIN'); insert into authorities(username,authority) values ('admin1@example.com','ROLE_USER'); insert into authorities(username,authority) values ('user2@example.com','ROLE_USER'); insert into authorities(username,authority) ...Read now
Unlock full access