Search in sources :

Example 1 with FeedOpsAccessControlProvider

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;
}
Also used : JcrFeed(com.thinkbiganalytics.metadata.modeshape.feed.JcrFeed) FeedOpsAccessControlProvider(com.thinkbiganalytics.metadata.api.feed.security.FeedOpsAccessControlProvider) Node(javax.jcr.Node) ArrayList(java.util.ArrayList) Feed(com.thinkbiganalytics.metadata.api.feed.Feed) JcrFeed(com.thinkbiganalytics.metadata.modeshape.feed.JcrFeed)

Example 2 with FeedOpsAccessControlProvider

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));
}
Also used : Category(com.thinkbiganalytics.metadata.api.category.Category) Feed(com.thinkbiganalytics.metadata.api.feed.Feed) MetadataRepositoryException(com.thinkbiganalytics.metadata.modeshape.MetadataRepositoryException) SecurityRole(com.thinkbiganalytics.security.role.SecurityRole) RepositoryException(javax.jcr.RepositoryException) Node(javax.jcr.Node) Map(java.util.Map) Nonnull(javax.annotation.Nonnull) AccessControlledMixin(com.thinkbiganalytics.metadata.modeshape.security.mixin.AccessControlledMixin) AbstractJcrAuditableSystemEntity(com.thinkbiganalytics.metadata.modeshape.common.AbstractJcrAuditableSystemEntity) JcrPropertyUtil(com.thinkbiganalytics.metadata.modeshape.support.JcrPropertyUtil) RoleMembership(com.thinkbiganalytics.metadata.api.security.RoleMembership) FeedOpsAccessControlProvider(com.thinkbiganalytics.metadata.api.feed.security.FeedOpsAccessControlProvider) Set(java.util.Set) UserFieldDescriptor(com.thinkbiganalytics.metadata.api.extension.UserFieldDescriptor) Serializable(java.io.Serializable) HadoopSecurityGroup(com.thinkbiganalytics.metadata.api.security.HadoopSecurityGroup) JcrCategoryAllowedActions(com.thinkbiganalytics.metadata.modeshape.category.security.JcrCategoryAllowedActions) List(java.util.List) Principal(java.security.Principal) JcrAllowedActions(com.thinkbiganalytics.metadata.modeshape.security.action.JcrAllowedActions) Optional(java.util.Optional) JcrUtil(com.thinkbiganalytics.metadata.modeshape.support.JcrUtil) Collections(java.util.Collections) JcrEntity(com.thinkbiganalytics.metadata.modeshape.common.JcrEntity) Node(javax.jcr.Node)

Aggregations

Feed (com.thinkbiganalytics.metadata.api.feed.Feed)2 FeedOpsAccessControlProvider (com.thinkbiganalytics.metadata.api.feed.security.FeedOpsAccessControlProvider)2 Node (javax.jcr.Node)2 Category (com.thinkbiganalytics.metadata.api.category.Category)1 UserFieldDescriptor (com.thinkbiganalytics.metadata.api.extension.UserFieldDescriptor)1 HadoopSecurityGroup (com.thinkbiganalytics.metadata.api.security.HadoopSecurityGroup)1 RoleMembership (com.thinkbiganalytics.metadata.api.security.RoleMembership)1 MetadataRepositoryException (com.thinkbiganalytics.metadata.modeshape.MetadataRepositoryException)1 JcrCategoryAllowedActions (com.thinkbiganalytics.metadata.modeshape.category.security.JcrCategoryAllowedActions)1 AbstractJcrAuditableSystemEntity (com.thinkbiganalytics.metadata.modeshape.common.AbstractJcrAuditableSystemEntity)1 JcrEntity (com.thinkbiganalytics.metadata.modeshape.common.JcrEntity)1 JcrFeed (com.thinkbiganalytics.metadata.modeshape.feed.JcrFeed)1 JcrAllowedActions (com.thinkbiganalytics.metadata.modeshape.security.action.JcrAllowedActions)1 AccessControlledMixin (com.thinkbiganalytics.metadata.modeshape.security.mixin.AccessControlledMixin)1 JcrPropertyUtil (com.thinkbiganalytics.metadata.modeshape.support.JcrPropertyUtil)1 JcrUtil (com.thinkbiganalytics.metadata.modeshape.support.JcrUtil)1 SecurityRole (com.thinkbiganalytics.security.role.SecurityRole)1 Serializable (java.io.Serializable)1 Principal (java.security.Principal)1 ArrayList (java.util.ArrayList)1