Branch data Line data Source code
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 : : #ifndef _CONNECTIVITY_HSQLDB_USER_HXX_
21 : : #define _CONNECTIVITY_HSQLDB_USER_HXX_
22 : :
23 : : #include "connectivity/sdbcx/VUser.hxx"
24 : : #include "com/sun/star/sdbc/XConnection.hpp"
25 : :
26 : : namespace connectivity
27 : : {
28 : : namespace hsqldb
29 : : {
30 : : typedef connectivity::sdbcx::OUser OUser_TYPEDEF;
31 : :
32 : 0 : class OHSQLUser : public OUser_TYPEDEF
33 : : {
34 : : ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > m_xConnection;
35 : :
36 : : ::rtl::OUString getPrivilegeString(sal_Int32 nRights) const;
37 : : // return the privileges and additional the grant rights
38 : : void findPrivilegesAndGrantPrivileges(const ::rtl::OUString& objName, sal_Int32 objType,sal_Int32& nRights,sal_Int32& nRightsWithGrant) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
39 : : public:
40 : : virtual void refreshGroups();
41 : : public:
42 : : OHSQLUser( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _xConnection);
43 : : OHSQLUser( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _xConnection,const ::rtl::OUString& _Name);
44 : :
45 : : // XUser
46 : : virtual void SAL_CALL changePassword( const ::rtl::OUString& objPassword, const ::rtl::OUString& newPassword ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
47 : : // XAuthorizable
48 : : virtual sal_Int32 SAL_CALL getPrivileges( const ::rtl::OUString& objName, sal_Int32 objType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
49 : : virtual sal_Int32 SAL_CALL getGrantablePrivileges( const ::rtl::OUString& objName, sal_Int32 objType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
50 : : virtual void SAL_CALL grantPrivileges( const ::rtl::OUString& objName, sal_Int32 objType, sal_Int32 objPrivileges ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
51 : : virtual void SAL_CALL revokePrivileges( const ::rtl::OUString& objName, sal_Int32 objType, sal_Int32 objPrivileges ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
52 : : };
53 : :
54 : : class OUserExtend;
55 : : typedef ::comphelper::OPropertyArrayUsageHelper<OUserExtend> OUserExtend_PROP;
56 : :
57 : 0 : class OUserExtend : public OHSQLUser,
58 : : public OUserExtend_PROP
59 : : {
60 : : protected:
61 : : ::rtl::OUString m_Password;
62 : : // OPropertyArrayUsageHelper
63 : : virtual ::cppu::IPropertyArrayHelper* createArrayHelper() const;
64 : : // OPropertySetHelper
65 : : virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
66 : : public:
67 : : OUserExtend(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _xConnection);
68 : :
69 : : virtual void construct();
70 : : };
71 : : }
72 : : }
73 : : #endif // _CONNECTIVITY_HSQLDB_USER_HXX_
74 : :
75 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|