@Test(expected = AccessDeniedException.class) @WithMockUser(value = TEST_USER) public void createUserFailTest() { NgbUserVO userVO = new NgbUserVO(); userVO.setRoleIds(Collections.singletonList(2L)); userVO.setUserName(USER_2); userSecurityService.createUser(userVO); }
@PreAuthorize(ROLE_ADMIN) public NgbUser createUser(NgbUserVO userVO) { return userManager.createUser(userVO); }
UserSecurityService { @PreAuthorize(ROLE_ADMIN) public NgbUser createUser(NgbUserVO userVO) { return userManager.createUser(userVO); } }
UserSecurityService { @PreAuthorize(ROLE_ADMIN) public NgbUser createUser(NgbUserVO userVO) { return userManager.createUser(userVO); } @Autowired  UserSecurityService(UserManager userManager, AuthManager authManager); }
UserSecurityService { @PreAuthorize(ROLE_ADMIN) public NgbUser createUser(NgbUserVO userVO) { return userManager.createUser(userVO); } @Autowired  UserSecurityService(UserManager userManager, AuthManager authManager); @PreAuthorize(ROLE_ADMIN) List<NgbUser> loadAllUsers(); @PreAuthorize(ROLE_ADMIN) NgbUser loadUserByName(String name); @PreAuthorize(ROLE_ADMIN) NgbUser createUser(NgbUserVO userVO); @PreAuthorize(ROLE_ADMIN) NgbUser updateUser(final Long id, final NgbUserVO userVO); @PreAuthorize(ROLE_ADMIN) NgbUser loadUser(Long id); @PreAuthorize(ROLE_ADMIN) void deleteUser(Long id); @PreAuthorize(ROLE_ADMIN) NgbUser updateUserRoles(Long id, List<Long> roles); @PreAuthorize(ROLE_ADMIN) List<NgbUser> loadUsers(); @PreAuthorize(ROLE_USER) JwtRawToken issueTokenForCurrentUser(Long expiration); @PreAuthorize(ROLE_USER) UserContext getUserContext(); @PreAuthorize(ROLE_ADMIN) Collection<NgbUser> loadUsersByNames(IDList userList); @PreAuthorize(ROLE_ADMIN) Collection<String> findGroups(final String prefix); }
UserSecurityService { @PreAuthorize(ROLE_ADMIN) public NgbUser createUser(NgbUserVO userVO) { return userManager.createUser(userVO); } @Autowired  UserSecurityService(UserManager userManager, AuthManager authManager); @PreAuthorize(ROLE_ADMIN) List<NgbUser> loadAllUsers(); @PreAuthorize(ROLE_ADMIN) NgbUser loadUserByName(String name); @PreAuthorize(ROLE_ADMIN) NgbUser createUser(NgbUserVO userVO); @PreAuthorize(ROLE_ADMIN) NgbUser updateUser(final Long id, final NgbUserVO userVO); @PreAuthorize(ROLE_ADMIN) NgbUser loadUser(Long id); @PreAuthorize(ROLE_ADMIN) void deleteUser(Long id); @PreAuthorize(ROLE_ADMIN) NgbUser updateUserRoles(Long id, List<Long> roles); @PreAuthorize(ROLE_ADMIN) List<NgbUser> loadUsers(); @PreAuthorize(ROLE_USER) JwtRawToken issueTokenForCurrentUser(Long expiration); @PreAuthorize(ROLE_USER) UserContext getUserContext(); @PreAuthorize(ROLE_ADMIN) Collection<NgbUser> loadUsersByNames(IDList userList); @PreAuthorize(ROLE_ADMIN) Collection<String> findGroups(final String prefix);  }