public abstract class AbstractAdminToolSecurityViewController extends AbstractAdminController
@RequestMapping(value="/users/roles", method=RequestMethod.GET) @ResponseBody public CollectiongetUserRoles() { //shoud return a collection of roles .. but it's optional } @RequestMapping(value="/users/changeState/{type}", method=RequestMethod.POST) @ResponseBody public String changeUserState(@RequestBody UserTO userTo, @PathVariable("type") String type) { return setUserState(userTo, type); } @RequestMapping(value="/users/addUser", method=RequestMethod.POST) @ResponseBody public String addUser(@RequestBody UserTO userTo) { //your implementation to add a new user } @RequestMapping(value="/users/updateUser", method=RequestMethod.POST) @ResponseBody public String updateUser(@RequestBody UserTO userTo) { //your implementation to update a existing user }
| Constructor and Description |
|---|
AbstractAdminToolSecurityViewController() |
| Modifier and Type | Method and Description |
|---|---|
protected static String |
getRolePrefix()
override this for another prefix. should end with underscore.
|
protected abstract AdminToolUserDetailsService |
getUserServiceDelegate()
should return the instance of
UserDetailsService |
protected String |
setUserState(UserTO userTo,
String type) |
protected String |
setUserState(UserTO userTo,
UserStateType type) |
protected Collection<org.springframework.security.core.GrantedAuthority> |
transformToSimpleAuthorities(Set<String> strAuthorities) |
protected Collection<org.springframework.security.core.GrantedAuthority> |
transformToSimpleAuthorities(Set<String> strAuthorities,
boolean appendRolePrefix)
transforms all authorities to upper case and append the prefix if appendRolePrefix = true
|
addCommonContextVars, addCommonContextVars, getRootContext, resolveLocale, resolveLocalepublic AbstractAdminToolSecurityViewController()
protected abstract AdminToolUserDetailsService getUserServiceDelegate()
UserDetailsServiceprotected String setUserState(UserTO userTo, String type)
userTo - type - setUserState(UserTO, UserStateType)protected static String getRolePrefix()
protected String setUserState(UserTO userTo, UserStateType type)
userTo - the user transfer objecttype - the user state type to changeprotected Collection<org.springframework.security.core.GrantedAuthority> transformToSimpleAuthorities(Set<String> strAuthorities)
strAuthorities - SimpleGrantedAuthoritytransformToSimpleAuthorities(Set, boolean)protected Collection<org.springframework.security.core.GrantedAuthority> transformToSimpleAuthorities(Set<String> strAuthorities, boolean appendRolePrefix)
strAuthorities - appendRolePrefix - SimpleGrantedAuthorityCopyright © 2016–2018. All rights reserved.