BAEL-2443: Implement JsonView filtering based on Spring security (#6254)
* BAEL-2443: Implement filtering with @JsonView based on spring security role * Cleanup test * Rename tests * Fix renaming roles after refactoring
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
package com.baeldung.controller;
|
||||
|
||||
import com.baeldung.spring.AppConfig.Role;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class View {
|
||||
|
||||
public static final Map<Role, Class> MAPPING = new HashMap<>();
|
||||
|
||||
static {
|
||||
MAPPING.put(Role.ROLE_ADMIN, Admin.class);
|
||||
MAPPING.put(Role.ROLE_USER, User.class);
|
||||
}
|
||||
|
||||
public static class User {
|
||||
|
||||
}
|
||||
|
||||
public static class Admin extends User {
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user