blob: 04c16e822e9f67533ce9a67823f0f264edbec674 [file]
package org.casbin.command;
import org.casbin.NewEnforcer;
public class EnforceCommand extends AbstractCommand {
@Override
public String run(NewEnforcer enforcer, String... args) throws Exception {
String subject = args[0];
String object = args[1];
String action = args[2];
boolean res = enforcer.enforce(subject, object, action);
System.out.println(res ? "Allowed" : "Denied");
return String.valueOf(res);
}
}