1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 #ifndef INCLUDED_CONNECTIVITY_SOURCE_INC_HSQLDB_HUSER_HXX
21 #define INCLUDED_CONNECTIVITY_SOURCE_INC_HSQLDB_HUSER_HXX
23 #include <connectivity/sdbcx/VUser.hxx>
24 #include <com/sun/star/sdbc/XConnection.hpp>
26 namespace connectivity
30 typedef connectivity::sdbcx::OUser OUser_TYPEDEF
;
32 class OHSQLUser
: public OUser_TYPEDEF
34 css::uno::Reference
< css::sdbc::XConnection
> m_xConnection
;
36 static OUString
getPrivilegeString(sal_Int32 nRights
);
37 // return the privileges and additional the grant rights
38 /// @throws css::sdbc::SQLException
39 /// @throws css::uno::RuntimeException
40 void findPrivilegesAndGrantPrivileges(const OUString
& objName
, sal_Int32 objType
,sal_Int32
& nRights
,sal_Int32
& nRightsWithGrant
);
42 virtual void refreshGroups() override
;
44 OHSQLUser( const css::uno::Reference
< css::sdbc::XConnection
>& _xConnection
);
45 OHSQLUser( const css::uno::Reference
< css::sdbc::XConnection
>& _xConnection
,const OUString
& Name
);
48 virtual void SAL_CALL
changePassword( const OUString
& objPassword
, const OUString
& newPassword
) override
;
50 virtual sal_Int32 SAL_CALL
getPrivileges( const OUString
& objName
, sal_Int32 objType
) override
;
51 virtual sal_Int32 SAL_CALL
getGrantablePrivileges( const OUString
& objName
, sal_Int32 objType
) override
;
52 virtual void SAL_CALL
grantPrivileges( const OUString
& objName
, sal_Int32 objType
, sal_Int32 objPrivileges
) override
;
53 virtual void SAL_CALL
revokePrivileges( const OUString
& objName
, sal_Int32 objType
, sal_Int32 objPrivileges
) override
;
57 typedef ::comphelper::OPropertyArrayUsageHelper
<OUserExtend
> OUserExtend_PROP
;
59 class OUserExtend
: public OHSQLUser
,
60 public OUserExtend_PROP
64 // OPropertyArrayUsageHelper
65 virtual ::cppu::IPropertyArrayHelper
* createArrayHelper() const override
;
67 virtual ::cppu::IPropertyArrayHelper
& SAL_CALL
getInfoHelper() override
;
69 OUserExtend(const css::uno::Reference
< css::sdbc::XConnection
>& _xConnection
);
71 virtual void construct() override
;
75 #endif // INCLUDED_CONNECTIVITY_SOURCE_INC_HSQLDB_HUSER_HXX
77 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */