univention.admin.handlers.shares package#

Submodules#

univention.admin.handlers.shares.print module#

UDM module for printer shares

class univention.admin.handlers.shares.print.object(co: None, lo: access, position: position | None, dn: str = '', superordinate: Self | None = None, attributes: dict[str, list[bytes]] | None = None)[source]#

Bases: simpleLdap

module = 'shares/print'#
default_containers_attribute_name = 'printers'#
univention.admin.handlers.shares.print.lookup(co: None, lo: access, filter_s: str, base: str = '', superordinate: simpleLdap | None = None, scope: str = 'sub', unique: bool = False, required: bool = False, timeout: int = -1, sizelimit: int = 0) list[simpleLdap][source]#
univention.admin.handlers.shares.print.identify(dn: str, attr: dict[str, list[bytes]], canonical: bool = False) None[source]#

univention.admin.handlers.shares.printer module#

UDM module for printers

class univention.admin.handlers.shares.printer.printerACLTypes[source]#

Bases: select

name = 'printerACLTypes'#
choices: Sequence[Any] = [('allow all', 'Allow all users.'), ('allow', 'Allow only chosen users/groups.'), ('deny', 'Deny chosen users/groups.')]#
univention.admin.handlers.shares.printer.unmapPrinterURI(value: list[bytes], encoding: tuple[str, ...] = ()) tuple[str, str][source]#
univention.admin.handlers.shares.printer.mapPrinterURI(value: list[str], encoding: tuple[str, ...] = ()) bytes[source]#
class univention.admin.handlers.shares.printer.object(co: None, lo: access, position: position, dn: str = '', superordinate: simpleLdap | None = None, attributes: dict[str, list[bytes]] | None = None)[source]#

Bases: simpleLdap

module = 'shares/printer'#
default_containers_attribute_name = 'printers'#
open() None[source]#

Opens this object.

During the initialization of this object the current set LDAP attributes are mapped into info. This method makes it possible to e.g. resolve external references to other objects which are not represented in the raw LDAP attributes of this object, for example the group memberships of a user.

By default only the open hook for extended attributes is called. This method can be subclassed.

Warning

If this method changes anything in self.info it must call save() afterwards.

Warning

If your are going to do any modifications (such as creating, modifying, moving, removing this object) this method must be called directly after the constructor and before modifying any property.

univention.admin.handlers.shares.printergroup module#

UDM module for printer groups

class univention.admin.handlers.shares.printergroup.object(co: None, lo: access, position: position | None, dn: str = '', superordinate: Self | None = None, attributes: dict[str, list[bytes]] | None = None)[source]#

Bases: simpleLdap

module = 'shares/printergroup'#
default_containers_attribute_name = 'printers'#
is_valid_printer_object()[source]#

univention.admin.handlers.shares.share module#

UDM module for all share objects

class univention.admin.handlers.shares.share.cscPolicy[source]#

Bases: select

name = 'cscPolicy'#
choices: Sequence[Any] = [('manual', 'manual'), ('documents', 'documents'), ('programs', 'programs'), ('disable', 'disable')]#
univention.admin.handlers.shares.share.boolToString(value)[source]#
univention.admin.handlers.shares.share.stringToBool(value)[source]#
univention.admin.handlers.shares.share.mapKeyAndValue(old)[source]#
univention.admin.handlers.shares.share.unmapKeyAndValue(old)[source]#
univention.admin.handlers.shares.share.unmap_samba_user_groups(value, encoding=())[source]#
>>> unmap_samba_user_groups([b'root fred,admin, @wheel, "Domain User", @"Domain Users"'])
['root', 'fred', 'admin', '@wheel', 'Domain User', '@Domain Users']

# FIXME: regex cannot handle this: >>> unmap_samba_user_groups([b’root +”some “ quoted” &option’]) # doctest: +SKIP [‘root’, ‘+some “ quoted’, ‘&option’]

univention.admin.handlers.shares.share.map_samba_user_groups(value, encoding=())[source]#

Turns @group name, user name into @”group name”, “user name”

>>> map_samba_user_groups(['root', 'fred', 'admin', '@wheel', 'Domain User', '&Domain Users', '+some " quoted', 'option"set'])
b'root, fred, admin, @wheel, "Domain User", &"Domain Users", +"some \\" quoted", "option\\"set"'
>>> map_samba_user_groups(['@"Domain Users"'])
b'@"Domain Users"'
univention.admin.handlers.shares.share.unmap_vfs_objects(value, encoding=())[source]#
univention.admin.handlers.shares.share.map_vfs_objects(value, encoding=())[source]#
class univention.admin.handlers.shares.share.object(co: None, lo: access, position: position | None, dn: str = '', superordinate: Self | None = None, attributes: dict[str, list[bytes]] | None = None)[source]#

Bases: simpleLdap

module = 'shares/share'#
open()[source]#

Opens this object.

During the initialization of this object the current set LDAP attributes are mapped into info. This method makes it possible to e.g. resolve external references to other objects which are not represented in the raw LDAP attributes of this object, for example the group memberships of a user.

By default only the open hook for extended attributes is called. This method can be subclassed.

Warning

If this method changes anything in self.info it must call save() afterwards.

Warning

If your are going to do any modifications (such as creating, modifying, moving, removing this object) this method must be called directly after the constructor and before modifying any property.

description()[source]#

Return a descriptive string for the object. By default the relative distinguished name is returned.

Returns:

A descriptive string or none as fallback.

check_options_for_validity()[source]#