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

br.com.caelum.brutauth.reflection.SimpleBrutauthRuleMethodInvoker Maven / Gradle / Ivy

There is a newer version: 4.0.4
Show newest version
package br.com.caelum.brutauth.reflection;

import br.com.caelum.brutauth.auth.rules.BrutauthRule;
import br.com.caelum.brutauth.auth.rules.SimpleBrutauthRule;

public class SimpleBrutauthRuleMethodInvoker implements MethodInvoker {

	public boolean invoke(BrutauthRule toInvoke, Argument[] args) {
		Argument argument = args[0];
		Long accessLevel = (Long) argument.getValue();
		return ((SimpleBrutauthRule) toInvoke).isAllowed(accessLevel);
	}

	@Override
	public boolean canInvoke(Class brutauthRule) {
		return SimpleBrutauthRule.class.isAssignableFrom(brutauthRule);
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy