Table of Contents

Class ModelRole

Inheritance
ModelRole
Implements
Inherited Members
Namespace
TabularEditor.TOMWrapper
Assembly
TOMWrapper.dll

Defines a set of user principals for whom security rules are applied. It is a child of a Model object.

public sealed class ModelRole : TabularNamedObject, ICustomTypeDescriptor, INotifyPropertyChanging, IComparable, IDescriptionObject, IAnnotationObject, IExtendedPropertyObject, IClonableObject, ITabularObjectContainer, ITabularNamedObject, ITabularObject, INotifyPropertyChanged, INamedObject
Extension Methods

Properties

Annotations

The collection of Annotations on the current Model Role.

[Browsable(true)]
public AnnotationCollection Annotations { get; }

Property Value

Type Description
AnnotationCollection

Description

The description of the role, visible to developers at design time and to administrators in management tools, such as SQL Server Management Studio.

public string Description { get; set; }

Property Value

Type Description
string

ExtendedProperties

The collection of Extended Properties on the current Model Role.

public ExtendedPropertyCollection ExtendedProperties { get; }

Property Value

Type Description
ExtendedPropertyCollection

Members

The collection of ModelRoleMember objects on this ModelRole.

public ModelRoleMemberCollection Members { get; }

Property Value

Type Description
ModelRoleMemberCollection

MetadataPermission

The OLS settings defined for this role

[Browsable(true)]
public RoleOLSIndexer MetadataPermission { get; }

Property Value

Type Description
RoleOLSIndexer

ModelPermission

The level of access for this role. Possible values are as follows. None (1): The role has no access to the model. Read (2): The role can read metadata and data of the model. ReadRefresh (3): The role has read and refresh permission. Refresh (4): The role can refresh the data and calculations in the model. Administrator (5): The role can administer the model.

public ModelPermission ModelPermission { get; set; }

Property Value

Type Description
ModelPermission

Parent

The parent Model of the current Model Role.

public Model Parent { get; }

Property Value

Type Description
Model

RoleMembers

Specify domain/usernames of the members in this role. One member per line. DEPRECATED: Use the Members collection instead.

[Browsable(false)]
public string RoleMembers { get; set; }

Property Value

Type Description
string

RowLevelSecurity

The RLS settings defined for this role

[Browsable(true)]
public RoleRLSIndexer RowLevelSecurity { get; }

Property Value

Type Description
RoleRLSIndexer

TablePermissions

The collection of TablePermission objects on this ModelRole.

public TablePermissionCollection TablePermissions { get; }

Property Value

Type Description
TablePermissionCollection

Methods

AddExternalMember(string, string)

Adds an Azure AD member to this role.

public ExternalModelRoleMember AddExternalMember(string memberName, string memberId = null)

Parameters

Type Name Description
string memberName
string memberId

Returns

Type Description
ExternalModelRoleMember

AddOrGetTablePermission(Table)

public TablePermission AddOrGetTablePermission(Table table)

Parameters

Type Name Description
Table table

Returns

Type Description
TablePermission

AddWindowsMember(string, string)

Adds a Windows AD member to this role.

public void AddWindowsMember(string memberName, string memberId = null)

Parameters

Type Name Description
string memberName
string memberId

ClearAnnotations()

Removes all annotations from this object.

public void ClearAnnotations()

ClearExtendedProperties()

Removes all Extended Properties from this object.

public void ClearExtendedProperties()

ClearMembers()

Removes all members from this role.

public void ClearMembers()

Clone(string)

Creates an exact copy of this ModelRole object.

public ModelRole Clone(string newName = null)

Parameters

Type Name Description
string newName

Returns

Type Description
ModelRole

CreateNew(Model, string)

Creates a new ModelRole and adds it to the parent Model. Also creates the underlying metadataobject and adds it to the TOM tree.

public static ModelRole CreateNew(Model parent, string name = null)

Parameters

Type Name Description
Model parent
string name

Returns

Type Description
ModelRole

GetAnnotation(int)

Gets the value of the annotation with the given index, assuming it exists.

public string GetAnnotation(int index)

Parameters

Type Name Description
int index

Returns

Type Description
string

GetAnnotation(string)

Gets the value of the annotation with the given name. Returns null if no such annotation exists.

public string GetAnnotation(string name)

Parameters

Type Name Description
string name

Returns

Type Description
string

GetAnnotations()

Gets a collection of all annotation names on the current Model Role.

public IEnumerable<string> GetAnnotations()

Returns

Type Description
IEnumerable<string>

GetAnnotationsCount()

Gets the number of annotations on the current Model Role.

public int GetAnnotationsCount()

Returns

Type Description
int

GetChildren()

public IEnumerable<ITabularNamedObject> GetChildren()

Returns

Type Description
IEnumerable<ITabularNamedObject>

GetExtendedProperties()

Gets a collection of all ExtendedProperty names on the current object.

public IEnumerable<string> GetExtendedProperties()

Returns

Type Description
IEnumerable<string>

GetExtendedProperty(int)

Gets the value of the ExtendedProperty with the given index, assuming it exists.

public string GetExtendedProperty(int index)

Parameters

Type Name Description
int index

Returns

Type Description
string

GetExtendedProperty(string)

Gets the value of the ExtendedProperty with the given name. Returns null if no such ExtendedProperty exists.

public string GetExtendedProperty(string name)

Parameters

Type Name Description
string name

Returns

Type Description
string

GetExtendedPropertyCount()

Gets the number of ExtendedProperties on the current object.

public int GetExtendedPropertyCount()

Returns

Type Description
int

GetExtendedPropertyType(int)

Gets the type of the ExtendedProperty with the given index, assuming it exists.

public ExtendedPropertyType GetExtendedPropertyType(int index)

Parameters

Type Name Description
int index

Returns

Type Description
ExtendedPropertyType

GetExtendedPropertyType(string)

Gets the type of the ExtendedProperty with the given name, assuming it exists.

public ExtendedPropertyType GetExtendedPropertyType(string name)

Parameters

Type Name Description
string name

Returns

Type Description
ExtendedPropertyType

GetNewAnnotationName()

Returns a unique name for a new annotation.

public string GetNewAnnotationName()

Returns

Type Description
string

GetNewExtendedPropertyName()

Returns a unique name for a new ExtendedProperty.

public string GetNewExtendedPropertyName()

Returns

Type Description
string

HasAnnotation(string)

Returns true if an annotation with the given name exists. Otherwise false.

public bool HasAnnotation(string name)

Parameters

Type Name Description
string name

Returns

Type Description
bool

HasExtendedProperty(string)

Returns true if an ExtendedProperty with the given name exists. Otherwise false.

public bool HasExtendedProperty(string name)

Parameters

Type Name Description
string name

Returns

Type Description
bool

Init()

Derived members should override this method to instantiate child objects

protected override void Init()

RemoveAnnotation(string)

Remove an annotation by the given name.

public void RemoveAnnotation(string name)

Parameters

Type Name Description
string name

RemoveExtendedProperty(string)

Remove an ExtendedProperty by the given name.

public void RemoveExtendedProperty(string name)

Parameters

Type Name Description
string name

SetAnnotation(int, string)

Sets the value of the annotation with the given index, assuming it exists.

public void SetAnnotation(int index, string value)

Parameters

Type Name Description
int index
string value

SetAnnotation(string, string)

Sets the value of the annotation having the given name. If no such annotation exists, it will be created. If value is set to null, the annotation will be removed.

public void SetAnnotation(string name, string value)

Parameters

Type Name Description
string name
string value

SetExtendedProperty(int, string, ExtendedPropertyType)

Sets the value of the ExtendedProperty with the given index, optionally specifiying the type (string or JSON) of the ExtendedProperty.

public void SetExtendedProperty(int index, string value, ExtendedPropertyType type)

Parameters

Type Name Description
int index
string value
ExtendedPropertyType type

SetExtendedProperty(string, string, ExtendedPropertyType)

Sets the value of the ExtendedProperty having the given name. If no such ExtendedProperty exists, it will be created. If value is set to null, the ExtendedProperty will be removed.

public void SetExtendedProperty(string name, string value, ExtendedPropertyType type)

Parameters

Type Name Description
string name
string value
ExtendedPropertyType type