QtCraft API C++ classes QML types Handbook

QcOwnerOnlyAccess Namespace

Access lists of secret files on Windows (decision E-901), where Qt's permission bits only set the read-only attribute: a file inherits the access list of its folder unless it gets its own. More...

Header: #include <common/auth/QcOwnerOnlyAccess.h>

Functions

bool othersMayRead(const QString &path)
bool restrictToOwner(const QString &path)

Detailed Description

Without effect on macOS and Linux (QcSecretFile uses the permission bits there).

Function Documentation

bool QcOwnerOnlyAccess::othersMayRead(const QString &path)

Returns whether the access list of the file at path lets Everyone, Users or Authenticated Users read it; false outside Windows.

bool QcOwnerOnlyAccess::restrictToOwner(const QString &path)

Gives the file at path a protected access list that lets only the current user in (nothing inherited from the folder). Returns false when the file system has no access lists (FAT) or the call fails; true without doing anything outside Windows.