Пример #1
0
 /// <summary>
 /// Associates/dissociates the given user with/from a role based on toggle
 /// parameter.
 /// </summary>
 /// <remarks>
 /// Required permissions: Users.Edit.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='id'>
 /// key: Id
 /// </param>
 /// <param name='toggleRoleParameters'>
 /// &lt;para /&gt;Toggle - States whether to associate or to dissociate the
 /// role with/from the user.
 /// &lt;para /&gt;Role - The name of the role to be associated/dissociated.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task ToggleRoleByIdAsync(this IUsers operations, long id, ToggleRoleParameters toggleRoleParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
 {
     (await operations.ToggleRoleByIdWithHttpMessagesAsync(id, toggleRoleParameters, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
Пример #2
0
 /// <summary>
 /// Associates/dissociates the given user with/from a role based on toggle
 /// parameter.
 /// </summary>
 /// <remarks>
 /// Required permissions: Users.Edit.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='id'>
 /// key: Id
 /// </param>
 /// <param name='toggleRoleParameters'>
 /// &lt;para /&gt;Toggle - States whether to associate or to dissociate the
 /// role with/from the user.
 /// &lt;para /&gt;Role - The name of the role to be associated/dissociated.
 /// </param>
 public static void ToggleRoleById(this IUsers operations, long id, ToggleRoleParameters toggleRoleParameters)
 {
     operations.ToggleRoleByIdAsync(id, toggleRoleParameters).GetAwaiter().GetResult();
 }