LibreOffice Module connectivity (master) 1
YUser.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
25namespace connectivity::mysql
26 {
28
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 OMySQLUser( css::uno::Reference< css::sdbc::XConnection > _xConnection);
42 OMySQLUser( 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 OMySQLUser,
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: YUser.cxx:56
virtual void SAL_CALL revokePrivileges(const OUString &objName, sal_Int32 objType, sal_Int32 objPrivileges) override
Definition: YUser.cxx:238
virtual void SAL_CALL grantPrivileges(const OUString &objName, sal_Int32 objType, sal_Int32 objPrivileges) override
Definition: YUser.cxx:210
virtual sal_Int32 SAL_CALL getGrantablePrivileges(const OUString &objName, sal_Int32 objType) override
Definition: YUser.cxx:200
virtual sal_Int32 SAL_CALL getPrivileges(const OUString &objName, sal_Int32 objType) override
Definition: YUser.cxx:83
static OUString getPrivilegeString(sal_Int32 nRights)
Definition: YUser.cxx:282
OMySQLUser(css::uno::Reference< css::sdbc::XConnection > _xConnection)
Definition: YUser.cxx:41
void findPrivilegesAndGrantPrivileges(const OUString &objName, sal_Int32 objType, sal_Int32 &nRights, sal_Int32 &nRightsWithGrant)
Definition: YUser.cxx:93
virtual void SAL_CALL changePassword(const OUString &objPassword, const OUString &newPassword) override
Definition: YUser.cxx:267
css::uno::Reference< css::sdbc::XConnection > m_xConnection
Definition: YUser.hxx:31
virtual ::cppu::IPropertyArrayHelper &SAL_CALL getInfoHelper() override
virtual void construct() override
OUserExtend(const css::uno::Reference< css::sdbc::XConnection > &_xConnection)
virtual ::cppu::IPropertyArrayHelper * createArrayHelper() const override
connectivity::sdbcx::OUser OUser_TYPEDEF
Definition: YUser.hxx:27
::comphelper::OPropertyArrayUsageHelper< OUserExtend > OUserExtend_PROP
Definition: YUser.hxx:53