Sha256: cf1ad559c5c62e3b869328728d83fa60eeb68106471922b7ee55f6764d1315ac

Contents?: true

Size: 920 Bytes

Versions: 16

Compression:

Stored size: 920 Bytes

Contents

/**
 * @file
 * Declares utility functions for querying user properties
 */
#pragma once

#include <string>

namespace leatherman { namespace windows { namespace user {

    /**
     * Determines whether the current process has Administrator privileges and can be expected to succeed at
     * tasks restricted to Administrators.
     * @return True if the current process has Administrator privileges, otherwise false.
     */
    bool is_admin();

    /**
     * Query token membership to determine whether the current user is a member of the Administrators group.
     * @return True if user is an Administrator, otherwise false.
     */
    bool check_token_membership();

    /**
     * Finds the user's home directory in a Ruby-compatible way.
     * @return The home directory, trying %HOME% > %HOMEDRIVE%%HOMEPATH% > %USERPROFILE%
     */
    std::string home_dir();

}}}  // namespace leatherman::windows::user

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
facter-3.12.2.cfacter.20181217 ext/facter/leatherman/windows/inc/leatherman/windows/user.hpp
facter-3.12.1.cfacter.20181031 ext/facter/leatherman/windows/inc/leatherman/windows/user.hpp
facter-3.11.6.cfacter.20181031 ext/facter/leatherman/windows/inc/leatherman/windows/user.hpp
facter-3.12.1.cfacter.20181023 ext/facter/leatherman/windows/inc/leatherman/windows/user.hpp
facter-3.11.5.cfacter.20181022 ext/facter/leatherman/windows/inc/leatherman/windows/user.hpp
facter-3.12.0.cfacter.20181004 ext/facter/leatherman/windows/inc/leatherman/windows/user.hpp
facter-3.12.0.cfacter.20181001 ext/facter/leatherman/windows/inc/leatherman/windows/user.hpp
facter-3.12.0.cfacter.20180918 ext/facter/leatherman/windows/inc/leatherman/windows/user.hpp
facter-3.11.4.cfacter.20180821 ext/facter/leatherman/windows/inc/leatherman/windows/user.hpp
facter-3.11.3.cfacter.20180716 ext/facter/leatherman/windows/inc/leatherman/windows/user.hpp
facter-3.11.2.cfacter.20180612 ext/facter/leatherman/windows/inc/leatherman/windows/user.hpp
facter-3.9.6.cfacter.20180612 ext/facter/leatherman/windows/inc/leatherman/windows/user.hpp
facter-3.11.2.cfacter.20180606 ext/facter/leatherman/windows/inc/leatherman/windows/user.hpp
facter-3.9.6.cfacter.20180606 ext/facter/leatherman/windows/inc/leatherman/windows/user.hpp
facter-3.11.0.cfacter.20180319 ext/facter/leatherman/windows/inc/leatherman/windows/user.hpp
cfacter-3.11.0.rc.20180314 ext/facter/leatherman/windows/inc/leatherman/windows/user.hpp