cid#1607171 Data race condition
[LibreOffice.git] / connectivity / source / inc / hsqldb / HUser.hxx
blob67c44e185bd2e2a0c62ede0ef33bb9c6f8613e2f
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #pragma once
22 #include <sdbcx/VUser.hxx>
23 #include <com/sun/star/sdbc/XConnection.hpp>
25 namespace connectivity::hsqldb
27 typedef connectivity::sdbcx::OUser OUser_TYPEDEF;
29 class OHSQLUser : public OUser_TYPEDEF
31 css::uno::Reference< css::sdbc::XConnection > m_xConnection;
33 static OUString getPrivilegeString(sal_Int32 nRights);
34 // return the privileges and additional the grant rights
35 /// @throws css::sdbc::SQLException
36 /// @throws css::uno::RuntimeException
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);
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;
53 class OUserExtend;
54 typedef ::comphelper::OPropertyArrayUsageHelper<OUserExtend> OUserExtend_PROP;
56 class OUserExtend : public OHSQLUser,
57 public OUserExtend_PROP
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);
68 virtual void construct() override;
73 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */