• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeio/tdeio
 

tdeio/tdeio

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

#include <kacl.h>

Public Member Functions

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

Protected Member Functions

virtual void virtual_hook (int id, void *data)
 

Friends

TDEIO_EXPORT friend TQDataStream & operator<< (TQDataStream &s, const KACL &a)
 
TDEIO_EXPORT friend TQDataStream & operator>> (TQDataStream &s, KACL &a)
 

Detailed Description

The KCAL 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 42 of file kacl.h.

Constructor & Destructor Documentation

◆ KACL() [1/4]

KACL::KACL ( const TQString &  aclString)

Creates a new KACL from aclString.

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

Definition at line 76 of file kacl.cpp.

◆ KACL() [2/4]

KACL::KACL ( const KACL &  rhs)

Copy ctor.

Definition at line 99 of file kacl.cpp.

◆ KACL() [3/4]

KACL::KACL ( mode_t  basicPermissions)

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

isValid() will return true, afterwards.

Definition at line 82 of file kacl.cpp.

◆ KACL() [4/4]

KACL::KACL ( )

Creates an empty KACL.

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

Definition at line 94 of file kacl.cpp.

Member Function Documentation

◆ allGroupPermissions()

ACLGroupPermissionsList KACL::allGroupPermissions ( ) const

Returns the list of all group permission entries.

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

Returns
the list of all group permission entries.

Definition at line 546 of file kacl.cpp.

◆ allUserPermissions()

ACLUserPermissionsList KACL::allUserPermissions ( ) const

Returns the list of all group permission entries.

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

Returns
the list of all group permission entries.

Definition at line 408 of file kacl.cpp.

◆ asString()

TQString 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 606 of file kacl.cpp.

◆ basePermissions()

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

Definition at line 257 of file kacl.cpp.

◆ isExtended()

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 130 of file kacl.cpp.

◆ isValid()

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 119 of file kacl.cpp.

◆ maskPermissions()

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 274 of file kacl.cpp.

◆ namedGroupPermissions()

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

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

exists 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 509 of file kacl.cpp.

◆ namedUserPermissions()

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

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

exists 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 315 of file kacl.cpp.

◆ othersPermissions()

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

Definition at line 238 of file kacl.cpp.

◆ ownerPermissions()

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 200 of file kacl.cpp.

◆ owningGroupPermissions()

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

Definition at line 219 of file kacl.cpp.

◆ setACL()

bool KACL::setACL ( const TQString &  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 583 of file kacl.cpp.

◆ setAllGroupPermissions()

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 569 of file kacl.cpp.

◆ setAllUserPermissions()

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 494 of file kacl.cpp.

◆ setMaskPermissions()

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 302 of file kacl.cpp.

◆ setNamedGroupPermissions()

bool KACL::setNamedGroupPermissions ( const TQString &  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 534 of file kacl.cpp.

◆ setNamedUserPermissions()

bool KACL::setNamedUserPermissions ( const TQString &  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 397 of file kacl.cpp.

◆ setOthersPermissions()

bool KACL::setOthersPermissions ( unsigned short  v)

Set the permissions entry for others.

Returns
success or failure

Definition at line 247 of file kacl.cpp.

◆ setOwnerPermissions()

bool KACL::setOwnerPermissions ( unsigned short  v)

Set the owner's permissions entry.

Returns
success or failure

Definition at line 209 of file kacl.cpp.

◆ setOwningGroupPermissions()

bool KACL::setOwningGroupPermissions ( unsigned short  v)

Set the owning group's permissions entry.

Returns
success or failure

Definition at line 228 of file kacl.cpp.


The documentation for this class was generated from the following files:
  • kacl.h
  • kacl.cpp

tdeio/tdeio

Skip menu "tdeio/tdeio"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

tdeio/tdeio

Skip menu "tdeio/tdeio"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeio/tdeio by doxygen 1.9.1
This website is maintained by Timothy Pearson.