[docs]classEdgeAclProvider:""" This object provides ACLs for tables based on the requesting user at request time. """
[docs]@staticmethoddefbuilder():""" Create a builder to construct an EdgeAclProvider :return: a new builder """returnEdgeAclProviderBuilder(_j_provider_type.builder())
@staticmethoddefadd_object_acl(group:str,value):_j_provider_type.addAcl(group,unwrap(value))def__init__(self,j_provider:jpy.JType):self.j_provider=jpy.cast(j_provider,_j_provider_type)ifself.j_providerisNone:raiseDHError("j_provider type is not io.deephaven.enterprise.database.Database")
[docs]defapply_to(self,table:Union[Table,RollupTable,TreeTable,PivotTable]):""" Attach this ACL Provider to a table :param table: the table to attach to :return: the table with the ACLs attached """ifisinstance(table,RollupTable):returnRollupTable(self.j_provider.applyTo(table.j_rollup_table),aggs=table.aggs,by=table.by,include_constituents=table.include_constituents)elifisinstance(table,TreeTable):returnTreeTable(self.j_provider.applyTo(table.j_tree_table),id_col=table.id_col,parent_col=table.parent_col)elifisinstance(table,PivotTable):returnPivotTable(self.j_provider.applyTo(table._j_pivot))returnTable(self.j_provider.applyTo(table.j_table))
[docs]defrow_acl(self,group:str,acl:_j_generator_type):""" Add a Row ACL for the specified group to the table. :param group: the group the ACL applies to :param acl: the generator that will produce a filter for a given user :return: this builder """self.j_builder.rowAcl(group,acl)returnself
[docs]defcolumn_acl(self,group:str,columns:list,acl:_j_generator_type):""" Add a Column ACL for the specified group and column to the table. :param group: the group the ACL applies to :param columns: the column the acl applies to :param acl: the generator that will produce a filter for a given user :return: this builder """self.j_builder.columnAcl(group,j_array_list(columns),acl)returnself
[docs]deforphan_promotion(self,promote_orphans:bool):""" Specify whether orphans should be promoted after applying this ACL to a tree table. Defaults to False and is ignored on other types of tables. :param promote_orphans: whether orphans should be promoted after applying this ACL :return: this builder """self.j_builder.orphanPromotion(promote_orphans)returnself
[docs]defbuild(self):""" Construct the completed EdgeAclProvider object from this builder state :return: a new EdgeAclProvider """returnEdgeAclProvider(self.j_builder.build())