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

net.sf.esfinge.gamification.guardian.auth.throphy.DenyTrophyAuthorizer Maven / Gradle / Ivy

package net.sf.esfinge.gamification.guardian.auth.throphy;

import org.esfinge.guardian.authorizer.Authorizer;
import org.esfinge.guardian.context.AuthorizationContext;

import net.sf.esfinge.gamification.achievement.Trophy;
import net.sf.esfinge.gamification.annotation.auth.trophy.DenyTrophy;
import net.sf.esfinge.gamification.guardian.AuthorizationProcessor;

public class DenyTrophyAuthorizer extends AuthorizationProcessor implements Authorizer {

	@Override
	public Boolean authorize(AuthorizationContext context, DenyTrophy securityAnnotation) {

		Trophy trophy = (Trophy) process(context, securityAnnotation);
		if (trophy.getName().equals(securityAnnotation.achievementName()))
			return false;

		return true;

	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy