ca.gc.aafc.dina.security.auth.ReadOnlyAuthorizationService Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dina-base-api Show documentation
Show all versions of dina-base-api Show documentation
Base DINA API package for Java built on SpringBoot and Crnk
The newest version!
package ca.gc.aafc.dina.security.auth;
import java.util.Set;
import ca.gc.aafc.dina.security.spring.SecurityChecker.Operations;
/**
* To be used with the {@link ca.gc.aafc.dina.repository.ReadOnlyDinaRepository} to return a correct set of
* permissions. Does not authorize and will return only read permission.
*/
public class ReadOnlyAuthorizationService implements DinaAuthorizationService {
public static final Set READ_ONLY_PERMISSION = Set.of(Operations.READ.getValue());
@Override
public void authorizeCreate(Object entity) {
}
@Override
public void authorizeRead(Object entity) {
}
@Override
public void authorizeUpdate(Object entity) {
}
@Override
public void authorizeDelete(Object entity) {
}
@Override
public Set getPermissionsForObject(Object target) {
return READ_ONLY_PERMISSION;
}
@Override
public String getName() {
return "ReadOnlyAuthorizationService";
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy