Class RBACProcessor
java.lang.Object
it.uniroma2.art.semanticturkey.rbac.RBACProcessor
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
authorizes
(String goal) This method returns the capabilities terms as a list of String.getRole()
void
initializeResources
(File roleFile) static void
void
-
Constructor Details
-
RBACProcessor
public RBACProcessor(File roleFile) throws alice.tuprolog.InvalidTheoryException, TheoryNotFoundException - Throws:
alice.tuprolog.InvalidTheoryException
TheoryNotFoundException
-
RBACProcessor
public RBACProcessor(String role) throws alice.tuprolog.InvalidTheoryException, TheoryNotFoundException - Throws:
alice.tuprolog.InvalidTheoryException
TheoryNotFoundException
-
-
Method Details
-
initializeResources
public void initializeResources(File roleFile) throws alice.tuprolog.InvalidTheoryException, TheoryNotFoundException - Throws:
alice.tuprolog.InvalidTheoryException
TheoryNotFoundException
-
getRole
-
getCapabilitiesAsStringList
public List<String> getCapabilitiesAsStringList() throws alice.tuprolog.MalformedGoalException, alice.tuprolog.NoSolutionException, alice.tuprolog.NoMoreSolutionExceptionThis method returns the capabilities terms as a list of String. It is better to use this method rather thangetCapabilitiesAsTermList()
since the method toString of the classTerm
serializes the "wildcard" _ followed by a so-called fingerprint (seeVar
. This fingerprint is increased each time, so eventual compare of string capabilities to term capabilities will fail due to this fingerprint even if the capabilities are the same.- Returns:
- Throws:
alice.tuprolog.MalformedGoalException
alice.tuprolog.NoSolutionException
alice.tuprolog.NoMoreSolutionException
-
runInterpreter
- Throws:
Exception
-
authorizes
public boolean authorizes(String goal) throws alice.tuprolog.MalformedGoalException, HaltedEngineException, HarmingGoalException - Throws:
alice.tuprolog.MalformedGoalException
HaltedEngineException
HarmingGoalException
-
main
- Throws:
Exception
-