/// <summary> /// Initializes a new instance of the EffectiveIdentity class. /// </summary> /// <param name="username">The effective username reflected by a token /// for applying RLS rules (For OnPrem model, username can be composed /// of alpha-numerical characters or any of the following characters /// '.', '-', '_', '!', '#', '^', '~', '\\', '@', also username cannot /// contain spaces. For Cloud model, username can be composed of all /// ASCII characters. username must be up to 256 characters)</param> /// <param name="datasets">An array of datasets for which this identity /// applies</param> /// <param name="roles">An array of roles reflected by a token when /// applying RLS rules (identity can contain up to 50 roles, role can /// be composed of any character besides ',' and must be up to 50 /// characters)</param> /// <param name="customData">The value of customdata to be used for /// applying RLS rules. Only supported for live connections to Azure /// Analysis Services.</param> /// <param name="identityBlob">Preview feature: The identity blob /// representing the identity that the generated token should /// reflect</param> public EffectiveIdentity(string username, IList <string> datasets, IList <string> roles = default(IList <string>), string customData = default(string), IdentityBlob identityBlob = default(IdentityBlob)) { Username = username; Roles = roles; Datasets = datasets; CustomData = customData; IdentityBlob = identityBlob; CustomInit(); }
/// <summary> /// Validate the object. /// </summary> /// <exception cref="ValidationException"> /// Thrown if validation fails /// </exception> public virtual void Validate() { if (Username == null) { throw new ValidationException(ValidationRules.CannotBeNull, "Username"); } if (IdentityBlob != null) { IdentityBlob.Validate(); } }