• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

KIO

Public Member Functions | Protected Member Functions | Friends | List of all members
KACL Class Reference

#include <kacl.h>

Public Member Functions

 KACL (const QString &aclString)
 
 KACL (const KACL &rhs)
 
 KACL (mode_t basicPermissions)
 
 KACL ()
 
virtual ~KACL ()
 
ACLGroupPermissionsList allGroupPermissions () const
 
ACLUserPermissionsList allUserPermissions () const
 
QString asString () const
 
mode_t basePermissions () const
 
bool isExtended () const
 
bool isValid () const
 
unsigned short maskPermissions (bool &exists) const
 
unsigned short namedGroupPermissions (const QString &name, bool *exists) const
 
unsigned short namedUserPermissions (const QString &name, bool *exists) const
 
bool operator!= (const KACL &rhs) const
 
KACL & operator= (const KACL &rhs)
 
bool operator== (const KACL &rhs) const
 
unsigned short othersPermissions () const
 
unsigned short ownerPermissions () const
 
unsigned short owningGroupPermissions () const
 
bool setACL (const QString &aclStr)
 
bool setAllGroupPermissions (const ACLGroupPermissionsList &)
 
bool setAllUserPermissions (const ACLUserPermissionsList &list)
 
bool setMaskPermissions (unsigned short)
 
bool setNamedGroupPermissions (const QString &name, unsigned short)
 
bool setNamedUserPermissions (const QString &name, unsigned short)
 
bool setOthersPermissions (unsigned short)
 
bool setOwnerPermissions (unsigned short)
 
bool setOwningGroupPermissions (unsigned short)
 

Protected Member Functions

virtual void virtual_hook (int id, void *data)
 

Friends

QDataStream & operator<< (QDataStream &s, const KACL &a)
 
QDataStream & operator>> (QDataStream &s, KACL &a)
 

Detailed Description

The KACL class encapsulates a POSIX Access Control List.

It follows the little standard that couldn't, 1003.1e/1003.2c, which died in draft status. a POSIX ACL encapsulation

Author
Till Adam adam@.nosp@m.kde..nosp@m.org

Definition at line 47 of file kacl.h.

Constructor & Destructor Documentation

KACL::KACL ( const QString &  aclString)

Creates a new KACL from aclString.

If the string is a valid acl string, isValid() will afterwards return true.

Definition at line 65 of file kacl.cpp.

KACL::KACL ( const KACL &  rhs)

Copy ctor.

Definition at line 88 of file kacl.cpp.

KACL::KACL ( mode_t  basicPermissions)

Creates a new KACL from the basic permissions passed in basicPermissions.

isValid() will return true, afterwards.

Definition at line 71 of file kacl.cpp.

KACL::KACL ( )

Creates an empty KACL.

Until a valid acl string is set via setACL, isValid() will return false.

Definition at line 83 of file kacl.cpp.

KACL::~KACL ( )
virtual

Definition at line 94 of file kacl.cpp.

Member Function Documentation

ACLGroupPermissionsList KACL::allGroupPermissions ( ) const

Returns the list of all group permission entries.

Each entry consists of a name/permissions pair. This is a QPair, therefor access is provided via the .first and .next members.

Returns
the list of all group permission entries.

Definition at line 553 of file kacl.cpp.

ACLUserPermissionsList KACL::allUserPermissions ( ) const

Returns the list of all group permission entries.

Each entry consists of a name/permissions pair. This is a QPair, therefore access is provided via the .first and .next members.

Returns
the list of all group permission entries.

Definition at line 415 of file kacl.cpp.

QString KACL::asString ( ) const

Return a string representation of the ACL.

Returns
a string version of the ACL in the format compatible with libacl and POSIX 1003.1e. Implementations conforming to that standard should be able to take such strings as input.

Definition at line 610 of file kacl.cpp.

mode_t KACL::basePermissions ( ) const
Returns
the basic (owner/group/others) part of the ACL as a mode_t

Definition at line 264 of file kacl.cpp.

bool KACL::isExtended ( ) const

The interface to the extended ACL.

This is a mask, permissions for n named users and permissions for m named groups. Return whether the ACL contains extended entries or can be expressed using only basic file permissions.

Returns
whether the ACL contains extended entries

Definition at line 131 of file kacl.cpp.

bool KACL::isValid ( ) const

Returns whether the KACL object represents a valid acl.

Returns
whether the KACL object represents a valid acl.

Definition at line 120 of file kacl.cpp.

unsigned short KACL::maskPermissions ( bool &  exists) const

Return the entry for the permissions mask if there is one and sets exists to true.

If there is no such entry, exists is set to false.

Returns
the permissions mask entry

Definition at line 281 of file kacl.cpp.

unsigned short KACL::namedGroupPermissions ( const QString &  name,
bool *  exists 
) const

Access to the permissions entry for a named group, if such an entry exists.

If exists is non-null, the boolean variable it points to is set to true if a matching entry exists and to false otherwise.

Returns
the permissions for a group with the name in name

Definition at line 516 of file kacl.cpp.

unsigned short KACL::namedUserPermissions ( const QString &  name,
bool *  exists 
) const

Access to the permissions entry for a named user, if such an entry exists.

If exists is non-null, the boolean variable it points to is set to true if a matching entry exists and to false otherwise.

Returns
the permissions for a user entry with the name in name

Definition at line 322 of file kacl.cpp.

bool KACL::operator!= ( const KACL &  rhs) const

Definition at line 115 of file kacl.cpp.

KACL & KACL::operator= ( const KACL &  rhs)

Definition at line 99 of file kacl.cpp.

bool KACL::operator== ( const KACL &  rhs) const

Definition at line 106 of file kacl.cpp.

unsigned short KACL::othersPermissions ( ) const
Returns
the premissions entry for others

Definition at line 245 of file kacl.cpp.

unsigned short KACL::ownerPermissions ( ) const

The standard (non-extended) part of an ACL.

These map directly to standard unix file permissions. Setting them will never make a valid ACL invalid.

Returns
the owner's premissions entry

Definition at line 207 of file kacl.cpp.

unsigned short KACL::owningGroupPermissions ( ) const
Returns
the owning group's premissions entry

Definition at line 226 of file kacl.cpp.

bool KACL::setACL ( const QString &  aclStr)

Sets the whole list from a string.

If the string in aclStr represents a valid ACL, it will be set, otherwise the ACL remains unchanged.

Returns
whether setting the ACL was successful.

Definition at line 590 of file kacl.cpp.

bool KACL::setAllGroupPermissions ( const ACLGroupPermissionsList &  groups)

Replace the list of all user permissions with list.

If one of the entries in the list does not exists, or setting of the ACL entry fails for any reason, the ACL will be left unchanged.

Returns
success or failure

Definition at line 576 of file kacl.cpp.

bool KACL::setAllUserPermissions ( const ACLUserPermissionsList &  list)

Replace the list of all user permissions with list.

If one of the entries in the list does not exists, or setting of the ACL entry fails for any reason, the ACL will be left unchanged.

Returns
success or failure

Definition at line 501 of file kacl.cpp.

bool KACL::setMaskPermissions ( unsigned short  v)

Set the permissions mask for the ACL.

Permissions set for individual entries will be masked with this, such that their effective permissions are the result of the logical and of their entry and the mask.

Returns
success or failure

Definition at line 309 of file kacl.cpp.

bool KACL::setNamedGroupPermissions ( const QString &  name,
unsigned short  permissions 
)

Set the permissions for a group with the name name.

Will fail if the group doesn't exist, in which case the ACL be unchanged.

Returns
success or failure.

Definition at line 541 of file kacl.cpp.

bool KACL::setNamedUserPermissions ( const QString &  name,
unsigned short  permissions 
)

Set the permissions for a user with the name name.

Will fail if the user doesn't exist, in which case the ACL will be unchanged.

Returns
success or failure.

Definition at line 404 of file kacl.cpp.

bool KACL::setOthersPermissions ( unsigned short  v)

Set the permissions entry for others.

Returns
success or failure

Definition at line 254 of file kacl.cpp.

bool KACL::setOwnerPermissions ( unsigned short  v)

Set the owner's permissions entry.

Returns
success or failure

Definition at line 216 of file kacl.cpp.

bool KACL::setOwningGroupPermissions ( unsigned short  v)

Set the owning group's permissions entry.

Returns
success or failure

Definition at line 235 of file kacl.cpp.

void KACL::virtual_hook ( int  id,
void *  data 
)
protectedvirtual

Definition at line 655 of file kacl.cpp.

Friends And Related Function Documentation

QDataStream& operator<< ( QDataStream &  s,
const KACL &  a 
)
friend

Definition at line 658 of file kacl.cpp.

QDataStream& operator>> ( QDataStream &  s,
KACL &  a 
)
friend

Definition at line 664 of file kacl.cpp.


The documentation for this class was generated from the following files:
  • kacl.h
  • kacl.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:24:54 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KIO

Skip menu "KIO"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal