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

net.anotheria.anosite.photoserver.api.access.AccessAPI Maven / Gradle / Ivy

The newest version!
package net.anotheria.anosite.photoserver.api.access;

import net.anotheria.anoplass.api.API;
import net.anotheria.anosite.photoserver.shared.vo.PhotoVO;

import java.util.Map;

/**
 * {@link net.anotheria.anoplass.api.API} for checking access.
 *
 * @author Alexandr Bolbat
 * @version $Id: $Id
 */
public interface AccessAPI extends API {

	/**
	 * Is allowed for me (currently logged user) do some action on photo.
	 *
	 * @param action
	 * 		- action
	 * @return true if can or false
	 * @param photoId a long.
	 */
	boolean isAllowedForMe(PhotoAction action, long photoId);

	/**
	 * Is allowed for me (currently logged user) do some action on photo album.
	 *
	 * @return true if can or false
	 * @param action a {@link net.anotheria.anosite.photoserver.api.access.AlbumAction} object.
	 * @param albumId a long.
	 */
	boolean isAllowedForMe(AlbumAction action, long albumId);

	/**
	 * Is views allowed for photo with given id.
	 *
	 * @param photoId
	 * 		id of the photo
	 * @param parameters
	 * 		optional params
	 * @return {@link net.anotheria.anosite.photoserver.api.access.ViewAccessResponse}
	 */
	ViewAccessResponse isViewAllowed(long photoId, Map parameters);

	/**
	 * Is views allowed for given photo.
	 *
	 * @param photo
	 * 		{@link net.anotheria.anosite.photoserver.shared.vo.PhotoVO}
	 * @param parameters
	 * 		optional params
	 * @return {@link net.anotheria.anosite.photoserver.api.access.ViewAccessResponse}
	 */
	ViewAccessResponse isViewAllowed(PhotoVO photo, Map parameters);

	/**
	 * Register custom access provider.
	 *
	 * @param accessProvider
	 * 		- access provider instance
	 */
	void registerAccessProvider(AccessProvider accessProvider);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy