SwivelUser Documentation

From Swivel Knowledgebase
Jump to: navigation, search

Overview

Class name: SwivelUser

Namespace: swivelsecure.client

This class represents a single user in a SwivelAdminRequest or SwivelHelpdeskRequest. The documentation below refers to SwivelAdminAPIRequest, which is the Interface implemented by both of the above classes.

Typical usage of this class is to create an instance linked to an existing request, referring to a specific username. The user instance is then modified as required, and a method called on the request, passing the user instance, or a List of user instances, which adds an operation to the request. The completed request is then sent to the Swivel server.

Note that when using SwivelHelpdeskRequest, the only things that can be changed are the user's credentials, either explicitly, or using the UserReset methods on the request.

Constructor

SwivelUser(SwivelAdminAPIRequest req, string name)

req: The request to which this user instance will be sent
name: The username of an existing or new Swivel user

Methods

XmlElement AsElement(bool detail)

Generate the XmlElement representing this user instance.
This will be used to compile the request, and should not need to be used directly.
detail: True if the Element should contain user details. Otherwise, only the name attribute is included.
Returns a XmlElement instance representing the user

void Attach(params SwivelUserPolicy p)

Attach policies to this user. See the documentation for possible policy values.
p: The SwivelUserPolicy value(s) to apply to this user.

void Detach(params SwivelUserPolicy p)

Remove specified policies from this user. See the documentation for possible policy values.
p: The SwivelUserPolicy value(s) to apply to this user.

void Grant(params SwivelUserRight r)

Grant specified rights to this user.
r: The SwivelUserRight types to apply to this user.

void Revoke(params SwivelUserRight r)

Revoke specified rights from this user.
r: The SwivelUserRight types to revoke from this user.

void SetAlertTransport(string transName, string destination)

Set the alert transport for this user.
transName: The transport name. This must be defined on the Swivel server.
destination: The transport value, e.g. email address or phone number.
NOTE: This method is obsolete from Swivel server version 3.9.6 onwards: use SetUserAttribute instead.

void SetStringTransport(string transName, string destination)

Set the security strings transport for this user.
transName: The transport name. This must be defined on the Swivel server.
destination: The transport value, e.g. email address or phone number.
NOTE: This method is obsolete from Swivel server version 3.9.6 onwards: use SetUserAttribute instead.

void SetUserAttribute(string attrName, string attrValue)

Set the value of a user attribute for this user.
attrName the name of an attribute. This must be an attribute defined on the Swivel server.
attrValue the value of this attribute.
NOTE: This method is only available with Swivel server version 3.9.7 onwards. AgentVersion should be set to "3.97".

string ToString()

Overridden ToString() method.
Returns The user's details as an XML Element

Properties

The following properties are write-only, as this class is used only to set properties for a user.

List<string> Groups

Set the list of groups to which this user belongs. The groups must have been declared on the Swivel server.

string Password

Set the user's Swivel password. Typically, this is not used.

string PIN

Set the user's PIN.

bool AutoCreateCredentials

For new users only, if True, and neither PIN nor Password are specified,
generate a random PIN (and password if mandatory).

bool SendCredentials

If True, and the Alert transport is specified, send the user's current credentials to the Alert transport.

SwivelUserPolicy

SwivelUserPolicy is an enumeration representing policies which may be applied to the user. It has the following possible values, with associated meanings:

  • changePin :- User must change PIN after next logon.
  • disabled :- User account is disabled.
  • locked :- User account is locked.
  • pinNeverExpires :- User's PIN never expires.

For new users, policies not explicitly attached are not applied.

When editing existing users, if policies are not explicitly attached or detached, they are unchanged.

SwivelUserRight

SwivelUserRight is an enumeration representing the rights users can have on the Swivel server.

The following values are possible, with associated meanings:

  • dual :- User can login using dual channel
  • helpdesk :- User can login to the Helpdesk.
  • pinless :- User is PINless.
  • single :- User can login using Single Channel.
  • swivlet :- User can login using the mobile client

For new users, rights must be explicitly granted, or they will not apply.

When editing existing users, if rights are neither granted nor revoked, they remain unchanged.

Note that the rights implied by membership of a group are not relevant here: they must be explicitly set.

Note that it is not possible to create an administrator user via the API.