View only role

I want to create a role that can only view not modified things, and other roles can edit. Can you tell me how to proceed on this.

You would need to set all input fields to read-only

You could do that like this


The Method isUserInRole can be implmented like this

public boolean isUserInRole(String role) {
    Authentication auth = SecurityContextHolder.getContext().getAuthentication();
    return auth != null && auth.getAuthorities().stream().anyMatch(a ->   a.getAuthority().equals(role)));