use of com.thinkbiganalytics.metadata.modeshape.security.role.JcrSecurityRole in project kylo by Teradata.
the class AccessControlledMixin method disableAccessControl.
default void disableAccessControl(JcrAllowedActions prototype, Principal owner, List<SecurityRole> roles) {
JcrAllowedActions allowed = getJcrAllowedActions();
prototype.copy(allowed.getNode(), owner);
allowed.removeAccessControl(owner);
if (roles.isEmpty()) {
JcrEntityRoleMembership.removeAll(getNode());
} else {
roles.forEach(role -> JcrEntityRoleMembership.remove(getNode(), ((JcrSecurityRole) role).getNode(), JcrEntityRoleMembership.class));
}
}
use of com.thinkbiganalytics.metadata.modeshape.security.role.JcrSecurityRole in project kylo by Teradata.
the class CategoryDetails method enableFeedRoles.
public void enableFeedRoles(List<SecurityRole> feedRoles) {
Node feedRolesNode = JcrUtil.getOrCreateNode(getNode(), FEED_ROLE_MEMBERSHIPS, FEED_ROLE_MEMBERSHIPS_TYPE);
feedRoles.forEach(role -> JcrAbstractRoleMembership.create(feedRolesNode, ((JcrSecurityRole) role).getNode(), JcrFeedDefaultRoleMembership.class, this));
}
use of com.thinkbiganalytics.metadata.modeshape.security.role.JcrSecurityRole in project kylo by Teradata.
the class AccessControlledMixin method enableAccessControl.
default void enableAccessControl(JcrAllowedActions prototype, Principal owner, List<SecurityRole> roles) {
JcrAllowedActions allowed = getJcrAllowedActions();
prototype.copy(allowed.getNode(), owner, Privilege.JCR_ALL);
allowed.setupAccessControl(owner);
roles.forEach(role -> JcrAbstractRoleMembership.create(getNode(), ((JcrSecurityRole) role).getNode(), JcrEntityRoleMembership.class, allowed));
}
Aggregations