class
ScriptDeviceUserManagement.
ScriptDeviceUserManagement
Bases: object
This object represents the user management on a given device.
online_device
Gets the online device this user management was created from.
users
Gets the users on the device.
Modifications of this list will take place offline and come into effect by downloading the user management to the device.
groups
Gets the groups on the device.
Modifications of this list will take place offline and come into effect by downloading the user management to the device.
reload_from_program
Reloads the user management contents from the device object in the project.
store_to_project
Writes the current contents of the user management back to the device object in the project.
You should always use this method to persist your changes into the project. If you don't call this method, the project will contain an outdated state.
upload
Uploads the user and group information from the device.
download
Downloads the user and group information to the device.
load
element
Loads the contents of the given XML element into this user management object.
element (XmlElement) -- The element.
save
file_name=None
writer=None
Saves the contents of this user management object as XML into a string.
WARNING | |
---|---|
save() (1/3)
str
A string containing the XML representation of this user management.
save(file_path) (2/3)
Saves the contents of this user management object as XML into a file.
file_path (str) -- The file name.
save(writer) (3/3)
Saves the contents of this user management object as XML into an System.Xml.XmlWriter.
writer (XmlWriter) -- The writer.
class
ScriptDeviceUserManagement.
ScriptDeviceUserList
Bases: list
Represents a list of script device users.
flags
Gets flags concerning the entire user list.
DeviceUserManagementFlags
add
name
Adds a new user with the specified name.
name (str) -- The name of the new user.
ArgumentException -- A user with the specified name already exists.
NotSupportedException -- Adding new users is not supported. Check flags for the DeviceUserManagementFlags.Create flag in advance.
The newly created user.
remove
name
Removes the user with the specified name.
name (str) -- The name of the existing user.
Deleting existing users is not supported. Check ScriptDeviceUser.flags for the DeviceUserManagementFlags.Delete flag in advance.
Removing a member from a group in which the specified user is a member of is not supported. Check ScriptDeviceGroup.flags of all affected groups for the DeviceUserManagementFlags.RemoveMember flag in advance.
bool
True if the user existed and was removed, otherwise False
clear
Removes all users.
NotSupportedException -- Deleting existing users is not supported. Check ScriptDeviceUser.flags for the DeviceUserManagementFlags.Delete flag in advance. --OR-- Removing a member from a group in which the specified user is a member of is not supported. Check ScriptDeviceGroup.flags of all affected groups for the DeviceUserManagementFlags.RemoveMember flag in advance.
class
ScriptDeviceUserManagement.
ScriptDeviceGroupList
Bases: list
A list of groups on the device.
flags
Gets flags concerning the entire group list.
DeviceUserManagementFlags
add
name
Adds a new group with the specified name.
name (str) -- The name of the group.
str
The newly created group, or None if a group with the specified name already exists.
remove
name
Removes the group with the specified name.
name (str) -- The name of the existing group.
bool
True if the group existed and was removed, otherwise False
clear
Removes all groups.
class
ScriptDeviceUserManagement.
ScriptDeviceUser
Bases: object
An user on this device.
flags
Gets flags concerning this particular user.
DeviceUserManagementFlags
name
Gets or sets the name of the user.
NotSupportedException -- Editing this user is not supported. Check flags for the DeviceUserManagementFlags.Edit flag in advance.
ArgumentException -- A user with the specified name already exists.
str
set_password
password
Sets the password for this user.
password (str) -- The password to set.
password_hash
Gets or sets the encrypted password for this user.
NotSupportedException -- Editing this user is not supported. Check flags for the DeviceUserManagementFlags.Edit flag in advance.
str
set_user_flags
flags
Sets flags for the user.
flags (DeviceUserManagementFlags) -- The flags to set.
class
ScriptDeviceUserManagement.
ScriptDeviceGroup
Bases: object
A group of users, which have common rights on the device.
flags
Gets flags concerning this particular group.
DeviceUserManagementFlags
name
Gets or sets the name of the group.
NotSupportedException -- Editing this user is not supported. Check flags for the DeviceUserManagementFlags.Edit flag in advance.
ArgumentException -- A group with the specified name already exists.
str
user_members
Gets the list of all user names which are members of this group.
This list can be modifed in-place to add or remove users from this group.
list
group_members
Gets the list of all group names which are members of this group.
This list can be modifed in-place to add or remove groups from this group.
list
check_cyclic_membership
new_group_member
Checks whether adding the specified group member would cause a cyclic membership dependency.
new_group_member (str) -- The name of the new group membership to check.
True if adding the specified group member would cause a cycle, otherwise False.
bool