LibreOffice
LibreOffice 24.2 SDK C/C++ API Reference
Public Member Functions | Protected Attributes | List of all members
osl::Security Class Reference

Encapsulate security information for one user. More...

#include <security_decl.hxx>

Public Member Functions

 Security ()
 
 ~Security ()
 
bool logonUser (const rtl::OUString &strName, const rtl::OUString &strPasswd)
 get the security information for one user. More...
 
bool logonUser (const rtl::OUString &strName, const rtl::OUString &strPasswd, const rtl::OUString &strFileServer)
 get the security information for one user. More...
 
bool getUserIdent (rtl::OUString &strIdent) const
 get the ident of the logged in user. More...
 
bool getUserName (rtl::OUString &strName, bool bIncludeDomain=true) const
 get the name of the logged in user. More...
 
bool getHomeDir (rtl::OUString &strDirectory) const
 get the home directory of the logged in user. More...
 
bool getConfigDir (rtl::OUString &strDirectory) const
 get the directory for configuration data of the logged in user. More...
 
bool isAdministrator () const
 Query if the user who is logged in has administrator rights. More...
 
oslSecurity getHandle () const
 Returns the underlying oslSecurity handle. More...
 

Protected Attributes

oslSecurity m_handle
 

Detailed Description

Encapsulate security information for one user.

A object of this class is used to execute a process with the rights an security options of a specified user.

See also
Process::executeProcess

Constructor & Destructor Documentation

◆ Security()

osl::Security::Security ( )
inline

◆ ~Security()

osl::Security::~Security ( )
inline

Member Function Documentation

◆ getConfigDir()

bool osl::Security::getConfigDir ( rtl::OUString strDirectory) const
inline

get the directory for configuration data of the logged in user.

Parameters
[out]strDirectoryis the OUString which returns the directory name
Return values
Trueif any user is successfully logged in
Falseif user is not logged in

◆ getHandle()

oslSecurity osl::Security::getHandle ( ) const
inline

Returns the underlying oslSecurity handle.

◆ getHomeDir()

bool osl::Security::getHomeDir ( rtl::OUString strDirectory) const
inline

get the home directory of the logged in user.

Parameters
[out]strDirectoryis the OUString which returns the directory name
Return values
Trueif any user is successfully logged in
Falseif user is not logged in

◆ getUserIdent()

bool osl::Security::getUserIdent ( rtl::OUString strIdent) const
inline

get the ident of the logged in user.

Parameters
[out]strIdentis the OUString which returns the name
Return values
Trueif any user is successfully logged in
Falseno user logged in

◆ getUserName()

bool osl::Security::getUserName ( rtl::OUString strName,
bool  bIncludeDomain = true 
) const
inline

get the name of the logged in user.

Parameters
[out]strNameis the OUString which returns the name
[in]bIncludeDomainInclude the Domain name (like "ORG\username"). Affects Windows only. This parameter is available since LibreOffice 5.2.
Return values
Trueif any user is successfully logged in
Falseif no user is logged in

◆ isAdministrator()

bool osl::Security::isAdministrator ( ) const
inline

Query if the user who is logged in has administrator rights.

Return values
Trueif the user has administrator rights
Falseif the user does not have admin rights

◆ logonUser() [1/2]

bool osl::Security::logonUser ( const rtl::OUString strName,
const rtl::OUString strPasswd 
)
inline

get the security information for one user.

The underlying operating system is asked for this information.

Parameters
[in]strNamedenotes the name of the user
[in]strPasswddenotes the password of this user
Return values
True,ifthe specified user is known by the underlying operating system
Falseunknown user

◆ logonUser() [2/2]

bool osl::Security::logonUser ( const rtl::OUString strName,
const rtl::OUString strPasswd,
const rtl::OUString strFileServer 
)
inline

get the security information for one user.

This method will try to login the user at the denoted file server.
If a network resource named \\server\username exists and this resource
could be connected by this user, the method will return true and getHomeDir
will return \\server\username.
Parameters
[in]strNamedenotes the name of the user
[in]strPasswddenotes the password of this user
[in]strFileServerdenotes the file server to login to
Return values
Trueif the specified user is known by the file server and they could be connected
Falseif the user is not known by the file server

Member Data Documentation

◆ m_handle

oslSecurity osl::Security::m_handle
protected

The documentation for this class was generated from the following files: