~ubuntu-branches/ubuntu/wily/tora/wily-proposed

« back to all changes in this revision

Viewing changes to src/tosecurity.h

  • Committer: Bazaar Package Importer
  • Author(s): Albin Tonnerre
  • Date: 2007-05-29 13:13:36 UTC
  • mfrom: (1.2.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20070529131336-85ygaddivvmkd3xc
Tags: 1.3.21pre22-1ubuntu1
* Merge from Debian unstable. Remaining Ubuntu changes:
  - debian/rules: call dh_iconcache
  - Remove g++ build dependency
* Modify Maintainer value to match Debian-Maintainer-Field Spec

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*****
 
2
*
 
3
* TOra - An Oracle Toolkit for DBA's and developers
 
4
* Copyright (C) 2003-2005 Quest Software, Inc
 
5
* Portions Copyright (C) 2005 Other Contributors
 
6
 
7
* This program is free software; you can redistribute it and/or
 
8
* modify it under the terms of the GNU General Public License
 
9
* as published by the Free Software Foundation;  only version 2 of
 
10
* the License is valid for this program.
 
11
 
12
* This program is distributed in the hope that it will be useful,
 
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
* GNU General Public License for more details.
 
16
 
17
* You should have received a copy of the GNU General Public License
 
18
* along with this program; if not, write to the Free Software
 
19
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
20
*
 
21
*      As a special exception, you have permission to link this program
 
22
*      with the Oracle Client libraries and distribute executables, as long
 
23
*      as you follow the requirements of the GNU GPL in regard to all of the
 
24
*      software in the executable aside from Oracle client libraries.
 
25
*
 
26
*      Specifically you are not permitted to link this program with the
 
27
*      Qt/UNIX, Qt/Windows or Qt Non Commercial products of TrollTech.
 
28
*      And you are not permitted to distribute binaries compiled against
 
29
*      these libraries without written consent from Quest Software, Inc.
 
30
*      Observe that this does not disallow linking to the Qt Free Edition.
 
31
*
 
32
*      You may link this product with any GPL'd Qt library such as Qt/Free
 
33
*
 
34
* All trademarks belong to their respective owners.
 
35
*
 
36
*****/
 
37
 
 
38
#ifndef TOSECURITY_H
 
39
#define TOSECURITY_H
 
40
 
 
41
#include "config.h"
 
42
#include "totool.h"
 
43
 
 
44
#include <list>
 
45
 
 
46
class QPopupMenu;
 
47
class QTabWidget;
 
48
class QToolButton;
 
49
class toConnection;
 
50
class toListView;
 
51
class toSecurityPage;
 
52
class toSecurityQuota;
 
53
 
 
54
class toSecuritySystem : public toListView
 
55
{
 
56
    Q_OBJECT
 
57
 
 
58
public:
 
59
    toSecuritySystem(QWidget *parent);
 
60
    void changeUser(const QString &);
 
61
    void eraseUser(bool all = true);
 
62
    void sql(const QString &user, std::list<QString> &sql);
 
63
    void update(void);
 
64
public slots:
 
65
    virtual void changed(QListViewItem *item);
 
66
};
 
67
 
 
68
class toSecurityRoleGrant : public toListView
 
69
{
 
70
    Q_OBJECT
 
71
 
 
72
    QCheckListItem *findChild(QListViewItem *parent, const QString &name);
 
73
public:
 
74
    toSecurityRoleGrant(QWidget *parent);
 
75
    void changeUser(bool user, const QString &);
 
76
    void sql(const QString &user, std::list<QString> &sql);
 
77
    void eraseUser(bool user, bool all = true);
 
78
    void update(void);
 
79
public slots:
 
80
    virtual void changed(QListViewItem *item);
 
81
};
 
82
 
 
83
class toSecurityObject : public toListView
 
84
{
 
85
    Q_OBJECT
 
86
 
 
87
public:
 
88
    toSecurityObject(QWidget *parent);
 
89
    void changeUser(const QString &);
 
90
    void sql(const QString &user, std::list<QString> &sql);
 
91
    void eraseUser(bool all = true);
 
92
    void update(void);
 
93
public slots:
 
94
    virtual void changed(QListViewItem *item);
 
95
};
 
96
 
 
97
class toSecurity : public toToolWidget
 
98
{
 
99
    Q_OBJECT
 
100
 
 
101
    struct privilege
 
102
    {
 
103
        QString Owner;
 
104
        QString Object;
 
105
        QString Access;
 
106
        QString Value;
 
107
        bool Admin;
 
108
        privilege(const QString &owner, const QString &object, const QString &access,
 
109
                  const QString &value, bool admin)
 
110
                : Owner(owner), Object(object), Access(access), Value(value), Admin(admin)
 
111
        { }
 
112
    }
 
113
    ;
 
114
 
 
115
    QString UserID;
 
116
 
 
117
    QPopupMenu *ToolMenu;
 
118
    toListView *UserList;
 
119
    toSecuritySystem *SystemGrant;
 
120
    toSecurityRoleGrant *RoleGrant;
 
121
    toSecurityObject *ObjectGrant;
 
122
    toSecurityPage *General;
 
123
    toSecurityQuota *Quota;
 
124
    QToolButton *DropButton;
 
125
    QToolButton *CopyButton;
 
126
    QTabWidget *Tabs;
 
127
    std::list<QString> sql(void);
 
128
public:
 
129
    toSecurity(QWidget *parent, toConnection &connection);
 
130
    virtual void changeUser(bool);
 
131
 
 
132
public slots:
 
133
    virtual void refresh(void);
 
134
    virtual void changeUser(QListViewItem *)
 
135
    {
 
136
        changeUser(true);
 
137
    }
 
138
    virtual void saveChanges(void);
 
139
    virtual void addUser(void);
 
140
    virtual void addRole(void);
 
141
    virtual void drop(void);
 
142
    virtual void copy(void);
 
143
    virtual void displaySQL(void);
 
144
    virtual void windowActivated(QWidget *widget);
 
145
};
 
146
 
 
147
#endif