1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: HUser.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _CONNECTIVITY_HSQLDB_USER_HXX_
32 #define _CONNECTIVITY_HSQLDB_USER_HXX_
34 #include "connectivity/sdbcx/VUser.hxx"
35 #include "com/sun/star/sdbc/XConnection.hpp"
37 namespace connectivity
41 typedef connectivity::sdbcx::OUser OUser_TYPEDEF
;
43 class OHSQLUser
: public OUser_TYPEDEF
45 ::com::sun::star::uno::Reference
< ::com::sun::star::sdbc::XConnection
> m_xConnection
;
47 ::rtl::OUString
getPrivilegeString(sal_Int32 nRights
) const;
48 // return the privileges and additional the grant rights
49 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
);
51 virtual void refreshGroups();
53 OHSQLUser( const ::com::sun::star::uno::Reference
< ::com::sun::star::sdbc::XConnection
>& _xConnection
);
54 OHSQLUser( const ::com::sun::star::uno::Reference
< ::com::sun::star::sdbc::XConnection
>& _xConnection
,const ::rtl::OUString
& _Name
);
57 virtual void SAL_CALL
changePassword( const ::rtl::OUString
& objPassword
, const ::rtl::OUString
& newPassword
) throw(::com::sun::star::sdbc::SQLException
, ::com::sun::star::uno::RuntimeException
);
59 virtual sal_Int32 SAL_CALL
getPrivileges( const ::rtl::OUString
& objName
, sal_Int32 objType
) throw(::com::sun::star::sdbc::SQLException
, ::com::sun::star::uno::RuntimeException
);
60 virtual sal_Int32 SAL_CALL
getGrantablePrivileges( const ::rtl::OUString
& objName
, sal_Int32 objType
) throw(::com::sun::star::sdbc::SQLException
, ::com::sun::star::uno::RuntimeException
);
61 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
);
62 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
);
66 typedef ::comphelper::OPropertyArrayUsageHelper
<OUserExtend
> OUserExtend_PROP
;
68 class OUserExtend
: public OHSQLUser
,
69 public OUserExtend_PROP
72 ::rtl::OUString m_Password
;
73 // OPropertyArrayUsageHelper
74 virtual ::cppu::IPropertyArrayHelper
* createArrayHelper() const;
76 virtual ::cppu::IPropertyArrayHelper
& SAL_CALL
getInfoHelper();
78 OUserExtend(const ::com::sun::star::uno::Reference
< ::com::sun::star::sdbc::XConnection
>& _xConnection
);
80 virtual void construct();
84 #endif // _CONNECTIVITY_HSQLDB_USER_HXX_