Exemplo n.º 1
0
 /// <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 RLS 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">A blob for specifying the identity. Only
 /// supported for datasets with Direct Query connection to SQL
 /// Azure</param>
 /// <param name="reports">An array of reports for which this identity
 /// applies, Only supported for paginated reports</param>
 public EffectiveIdentity(string username, IList <string> datasets = default(IList <string>), IList <string> roles = default(IList <string>), string customData = default(string), IdentityBlob identityBlob = default(IdentityBlob), IList <string> reports = default(IList <string>))
 {
     Username     = username;
     Datasets     = datasets;
     Roles        = roles;
     CustomData   = customData;
     IdentityBlob = identityBlob;
     Reports      = reports;
     CustomInit();
 }
Exemplo n.º 2
0
 /// <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();
     }
 }