"Fossies" - the Fresh Open Source Software Archive

Member "mumble-1.3.2/src/ACL.h" (9 Jul 2020, 1592 Bytes) of package /linux/misc/mumble-1.3.2.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "ACL.h" see the Fossies "Dox" file reference documentation and the last Fossies "Diffs" side-by-side code changes report: 1.2.19_vs_1.3.0.

    1 // Copyright 2005-2019 The Mumble Developers. All rights reserved.
    2 // Use of this source code is governed by a BSD-style license
    3 // that can be found in the LICENSE file at the root of the
    4 // Mumble source tree or at <https://www.mumble.info/LICENSE>.
    5 
    6 #ifndef MUMBLE_ACL_H_
    7 #define MUMBLE_ACL_H_
    8 
    9 #include <QtCore/QHash>
   10 #include <QtCore/QObject>
   11 
   12 class Channel;
   13 class User;
   14 class ServerUser;
   15 
   16 class ChanACL : public QObject {
   17     private:
   18         Q_OBJECT
   19         Q_DISABLE_COPY(ChanACL)
   20     public:
   21         enum Perm {
   22             None = 0x0,
   23             Write = 0x1,
   24             Traverse = 0x2,
   25             Enter = 0x4,
   26             Speak = 0x8,
   27             MuteDeafen = 0x10,
   28             Move = 0x20,
   29             MakeChannel = 0x40,
   30             LinkChannel = 0x80,
   31             Whisper = 0x100,
   32             TextMessage = 0x200,
   33             MakeTempChannel = 0x400,
   34 
   35             // Root channel only
   36             Kick = 0x10000,
   37             Ban = 0x20000,
   38             Register = 0x40000,
   39             SelfRegister = 0x80000,
   40 
   41             Cached = 0x8000000,
   42             All = 0xf07ff
   43         };
   44 
   45         Q_DECLARE_FLAGS(Permissions, Perm)
   46 
   47         typedef QHash<Channel *, Permissions> ChanCache;
   48         typedef QHash<User *, ChanCache * > ACLCache;
   49 
   50         Channel *c;
   51         bool bApplyHere;
   52         bool bApplySubs;
   53 
   54         bool bInherited;
   55 
   56         int iUserId;
   57         QString qsGroup;
   58         Permissions pAllow;
   59         Permissions pDeny;
   60 
   61         ChanACL(Channel *c);
   62 #ifdef MURMUR
   63         static bool hasPermission(ServerUser *p, Channel *c, QFlags<Perm> perm, ACLCache *cache);
   64         static QFlags<Perm> effectivePermissions(ServerUser *p, Channel *c, ACLCache *cache);
   65 #else
   66         static QString whatsThis(Perm p);
   67 #endif
   68         static QString permName(QFlags<Perm> p);
   69         static QString permName(Perm p);
   70 };
   71 
   72 Q_DECLARE_OPERATORS_FOR_FLAGS(ChanACL::Permissions)
   73 
   74 #endif