mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-14 08:45:36 +08:00
refs #474, role class so I can start with access rights in mapping GUI
Remark: Added upfront, as I need that for the screenshots when writing the BLOG article
This commit is contained in:
committed by
Mathew Sutcliffe
parent
eaa8339f2b
commit
e534a64d9a
47
src/blackgui/roles.h
Normal file
47
src/blackgui/roles.h
Normal file
@@ -0,0 +1,47 @@
|
||||
/* Copyright (C) 2015
|
||||
* swift project Community / Contributors
|
||||
*
|
||||
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
|
||||
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
|
||||
* including this file, may be copied, modified, propagated, or distributed except according to the terms
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
//! \file
|
||||
|
||||
#ifndef BLACKGUI_ROLES_H
|
||||
#define BLACKGUI_ROLES_H
|
||||
|
||||
#include "blackgui/blackguiexport.h"
|
||||
#include <QStringList>
|
||||
|
||||
namespace BlackGui
|
||||
{
|
||||
/*!
|
||||
* Roles
|
||||
*/
|
||||
class BLACKGUI_EXPORT CRoles
|
||||
{
|
||||
public:
|
||||
//! Has role?
|
||||
bool hasRole(const QString &role) const;
|
||||
|
||||
//! Admin?
|
||||
bool isAdmin() const;
|
||||
|
||||
//! Set admin
|
||||
void setAdmin(bool admin);
|
||||
|
||||
//! Roles
|
||||
static CRoles &roles();
|
||||
|
||||
private:
|
||||
//! Constructor
|
||||
CRoles();
|
||||
|
||||
QStringList m_roles;
|
||||
};
|
||||
|
||||
} // ns
|
||||
|
||||
#endif // guard
|
||||
Reference in New Issue
Block a user