use of com.thinkbiganalytics.metadata.api.feed.security.FeedOpsAccessControlProvider in project kylo by Teradata.
the class JcrFeedTemplate method getFeeds.
public List<Feed> getFeeds() {
List<Feed> feeds = new ArrayList<>();
Set<Node> feedNodes = JcrPropertyUtil.getSetProperty(this.node, FEEDS);
for (Node depNode : feedNodes) {
// TODO: note that feeds instances returned here will not be able to update feed ops
// access through permission changes to their allowed actions.
feeds.add(new JcrFeed(depNode, (FeedOpsAccessControlProvider) null));
}
return feeds;
}
use of com.thinkbiganalytics.metadata.api.feed.security.FeedOpsAccessControlProvider in project kylo by Teradata.
the class JcrCategory method createCategory.
/**
* Constructs a JcrCategory instance starting with either its base node or a child node, and an
* optional FeedOpsAccessControlProvider.
* @param node a tba:category type node or one of its child nodes
* @param accessPvdr the optional provider
* @return a new JcrCategory instance wrapping its derived base node
*/
public static JcrCategory createCategory(Node node, Optional<FeedOpsAccessControlProvider> accessPvdr) {
Node baseNode = node;
if (JcrUtil.isNodeType(node, CategoryDetails.NODE_TYPE)) {
baseNode = JcrUtil.getParent(node);
} else if (!JcrUtil.isNodeType(node, JcrCategory.NODE_TYPE)) {
throw new IllegalArgumentException("Unexpected node type for category: " + node);
}
final Node catNode = baseNode;
return accessPvdr.map(pvdr -> JcrUtil.createJcrObject(catNode, JcrCategory.class, pvdr)).orElse(JcrUtil.createJcrObject(catNode, JcrCategory.class));
}
Aggregations