All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ca.gc.aafc.dina.security.auth.ReadOnlyAuthorizationService Maven / Gradle / Ivy

There is a newer version: 0.132
Show 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