Search in sources :

Example 1 with MCRRuleStore

use of org.mycore.access.mcrimpl.MCRRuleStore in project mycore by MyCoRe-Org.

the class MCRWCMSAccessResource method getRuleList.

@GET
public String getRuleList() {
    JsonObject returnObject = new JsonObject();
    MCRRuleStore store = MCRRuleStore.getInstance();
    Collection<String> ruleIds = store.retrieveAllIDs();
    for (String id : ruleIds) {
        MCRAccessRule rule = store.getRule(id);
        returnObject.addProperty(rule.getId(), rule.getDescription());
    }
    return returnObject.toString();
}
Also used : JsonObject(com.google.gson.JsonObject) MCRAccessRule(org.mycore.access.mcrimpl.MCRAccessRule) MCRRuleStore(org.mycore.access.mcrimpl.MCRRuleStore) GET(javax.ws.rs.GET)

Aggregations

JsonObject (com.google.gson.JsonObject)1 GET (javax.ws.rs.GET)1 MCRAccessRule (org.mycore.access.mcrimpl.MCRAccessRule)1 MCRRuleStore (org.mycore.access.mcrimpl.MCRRuleStore)1