LibreOffice Module connectivity (master) 1
HUser.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#pragma once
21
22#include <sdbcx/VUser.hxx>
23#include <com/sun/star/sdbc/XConnection.hpp>
24
26 {
28
29 class OHSQLUser : public OUser_TYPEDEF
30 {
31 css::uno::Reference< css::sdbc::XConnection > m_xConnection;
32
33 static OUString getPrivilegeString(sal_Int32 nRights);
34 // return the privileges and additional the grant rights
37 void findPrivilegesAndGrantPrivileges(const OUString& objName, sal_Int32 objType,sal_Int32& nRights,sal_Int32& nRightsWithGrant);
38 public:
39 virtual void refreshGroups() override;
40 public:
41 OHSQLUser( css::uno::Reference< css::sdbc::XConnection > _xConnection);
42 OHSQLUser( css::uno::Reference< css::sdbc::XConnection > _xConnection, const OUString& Name);
43
44 // XUser
45 virtual void SAL_CALL changePassword( const OUString& objPassword, const OUString& newPassword ) override;
46 // XAuthorizable
47 virtual sal_Int32 SAL_CALL getPrivileges( const OUString& objName, sal_Int32 objType ) override;
48 virtual sal_Int32 SAL_CALL getGrantablePrivileges( const OUString& objName, sal_Int32 objType ) override;
49 virtual void SAL_CALL grantPrivileges( const OUString& objName, sal_Int32 objType, sal_Int32 objPrivileges ) override;
50 virtual void SAL_CALL revokePrivileges( const OUString& objName, sal_Int32 objType, sal_Int32 objPrivileges ) override;
51 };
52
53 class OUserExtend;
54 typedef ::comphelper::OPropertyArrayUsageHelper<OUserExtend> OUserExtend_PROP;
55
56 class OUserExtend : public OHSQLUser,
57 public OUserExtend_PROP
58 {
59 OUString m_Password;
60 protected:
61 // OPropertyArrayUsageHelper
62 virtual ::cppu::IPropertyArrayHelper* createArrayHelper() const override;
63 // OPropertySetHelper
64 virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override;
65 public:
66 OUserExtend(const css::uno::Reference< css::sdbc::XConnection >& _xConnection);
67
68 virtual void construct() override;
69 };
70
71}
72
73/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void refreshGroups() override
Definition: HUser.cxx:55
virtual void SAL_CALL changePassword(const OUString &objPassword, const OUString &newPassword) override
Definition: HUser.cxx:261
virtual sal_Int32 SAL_CALL getPrivileges(const OUString &objName, sal_Int32 objType) override
Definition: HUser.cxx:82
static OUString getPrivilegeString(sal_Int32 nRights)
Definition: HUser.cxx:284
OHSQLUser(css::uno::Reference< css::sdbc::XConnection > _xConnection)
Definition: HUser.cxx:41
virtual void SAL_CALL revokePrivileges(const OUString &objName, sal_Int32 objType, sal_Int32 objPrivileges) override
Definition: HUser.cxx:234
css::uno::Reference< css::sdbc::XConnection > m_xConnection
Definition: HUser.hxx:31
virtual void SAL_CALL grantPrivileges(const OUString &objName, sal_Int32 objType, sal_Int32 objPrivileges) override
Definition: HUser.cxx:207
virtual sal_Int32 SAL_CALL getGrantablePrivileges(const OUString &objName, sal_Int32 objType) override
Definition: HUser.cxx:197
void findPrivilegesAndGrantPrivileges(const OUString &objName, sal_Int32 objType, sal_Int32 &nRights, sal_Int32 &nRightsWithGrant)
Definition: HUser.cxx:92
OUserExtend(const css::uno::Reference< css::sdbc::XConnection > &_xConnection)
Definition: HUser.cxx:59
virtual ::cppu::IPropertyArrayHelper * createArrayHelper() const override
Definition: HUser.cxx:69
virtual ::cppu::IPropertyArrayHelper &SAL_CALL getInfoHelper() override
Definition: HUser.cxx:76
virtual void construct() override
Definition: HUser.cxx:64
::comphelper::OPropertyArrayUsageHelper< OUserExtend > OUserExtend_PROP
Definition: HUser.hxx:53
connectivity::sdbcx::OUser OUser_TYPEDEF
Definition: HUser.hxx:27