diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..318c747
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,9 @@
+/RPMS/
+*.list
+*.moc
+*.o
+*.pc
+*.so
+*.so.*
+moc_*
+qt/Makefile
diff --git a/Makefile b/glib/Makefile
similarity index 100%
rename from Makefile
rename to glib/Makefile
diff --git a/glib/glib.pro b/glib/glib.pro
new file mode 100644
index 0000000..fcc7c48
--- /dev/null
+++ b/glib/glib.pro
@@ -0,0 +1,9 @@
+# For QtCreator integration purposes. Not meant for building the project.
+TEMPLATE = aux
+
+HEADERS += sailfishaccesscontrol.h
+SOURCES += sailfishaccesscontrol.c
+
+OTHER_FILES += \
+ Makefile \
+ sailfishaccesscontrol.pc.tpl \
diff --git a/sailfishaccesscontrol.c b/glib/sailfishaccesscontrol.c
similarity index 100%
rename from sailfishaccesscontrol.c
rename to glib/sailfishaccesscontrol.c
diff --git a/sailfishaccesscontrol.h b/glib/sailfishaccesscontrol.h
similarity index 100%
rename from sailfishaccesscontrol.h
rename to glib/sailfishaccesscontrol.h
diff --git a/sailfishaccesscontrol.pc.tpl b/glib/sailfishaccesscontrol.pc.tpl
similarity index 100%
rename from sailfishaccesscontrol.pc.tpl
rename to glib/sailfishaccesscontrol.pc.tpl
diff --git a/qt/accesscontrol.cpp b/qt/accesscontrol.cpp
new file mode 100644
index 0000000..236c993
--- /dev/null
+++ b/qt/accesscontrol.cpp
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2019 Open Mobile Platform LLC.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see .
+ */
+
+#include "accesscontrol.h"
+#include "sailfishaccesscontrol.h"
+
+using namespace Sailfish;
+
+AccessControl::AccessControl(QObject *parent)
+ : QObject(parent)
+{
+}
+
+AccessControl::~AccessControl()
+{
+}
+
+bool AccessControl::hasGroup(int uid, const QString groupName)
+{
+ switch (uid) {
+ case RealUid:
+ uid = getuid();
+ break;
+ case EffectiveUid:
+ uid = geteuid();
+ break;
+ default:
+ Q_ASSERT_X(uid >= 0, Q_FUNC_INFO, "Uid must be either of enum type Uid or non-negative.");
+ break;
+ }
+ return sailfish_access_control_hasgroup(uid, groupName.toLatin1().data());
+}
diff --git a/qt/accesscontrol.h b/qt/accesscontrol.h
new file mode 100644
index 0000000..3a75828
--- /dev/null
+++ b/qt/accesscontrol.h
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2019 Open Mobile Platform LLC.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see .
+ */
+
+#ifndef SAILFISH_ACCESSCONTROL_H
+#define SAILFISH_ACCESSCONTROL_H
+
+#include
+
+namespace Sailfish {
+
+class AccessControl : public QObject
+{
+ Q_OBJECT
+
+public:
+ explicit AccessControl(QObject *parent = 0);
+ ~AccessControl();
+
+ enum Uid : int {
+ RealUid = -1,
+ EffectiveUid = -2
+ };
+ Q_ENUM(Uid)
+
+ Q_INVOKABLE bool hasGroup(int uid, const QString groupName);
+};
+
+}
+
+#endif // SAILFISH_ACCESSCONTROL_H
diff --git a/qt/plugin.cpp b/qt/plugin.cpp
new file mode 100644
index 0000000..ac7904a
--- /dev/null
+++ b/qt/plugin.cpp
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2019 Open Mobile Platform LLC.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see .
+ */
+
+#include
+#include
+#include
+
+#include "accesscontrol.h"
+
+using namespace Sailfish;
+
+template static QObject *singletonApiCallback(QQmlEngine *engine, QJSEngine *)
+{
+ return new T(engine);
+}
+
+class SailfishAccessControlPlugin : public QQmlExtensionPlugin
+{
+ Q_OBJECT
+ Q_PLUGIN_METADATA(IID "Sailfish.AccessControl" )
+
+public:
+ virtual void registerTypes(const char *uri)
+ {
+ if (QLatin1String(uri) == QLatin1String("Sailfish.AccessControl")) {
+ qmlRegisterSingletonType(uri, 1, 0, "AccessControl", singletonApiCallback);
+ }
+ }
+};
+
+#include "plugin.moc"
diff --git a/qt/qmldir b/qt/qmldir
new file mode 100644
index 0000000..7c6bcf2
--- /dev/null
+++ b/qt/qmldir
@@ -0,0 +1,2 @@
+module Sailfish.AccessControl
+plugin sailfishaccesscontrolplugin
diff --git a/qt/qt.pro b/qt/qt.pro
new file mode 100644
index 0000000..851a4d2
--- /dev/null
+++ b/qt/qt.pro
@@ -0,0 +1,29 @@
+MODULENAME = Sailfish/AccessControl
+DEFINES *= MODULENAME=\"\\\"\"$${MODULENAME}\"\\\"\"
+TEMPLATE = lib
+TARGET = sailfishaccesscontrolplugin
+TARGET = $$qtLibraryTarget($$TARGET)
+TARGETPATH = $$[QT_INSTALL_QML]/$$MODULENAME
+
+QT -= gui
+QT += qml
+CONFIG += \
+ plugin \
+ link_pkgconfig \
+ hide_symbols \
+ c++14
+
+PKGCONFIG += sailfishaccesscontrol
+
+HEADERS += accesscontrol.h
+
+SOURCES += plugin.cpp \
+ accesscontrol.cpp
+
+import.files = *.qml *.js qmldir plugins.qmltypes
+import.path = $$TARGETPATH
+target.path = $$TARGETPATH
+INSTALLS += target import
+
+QMAKE_CXXFLAGS += -Wall
+OTHER_FILES += qmldir *.qml *.js
diff --git a/rpm/sailfish-access-control-qt5.spec b/rpm/sailfish-access-control-qt5.spec
new file mode 100644
index 0000000..9b2a0c8
--- /dev/null
+++ b/rpm/sailfish-access-control-qt5.spec
@@ -0,0 +1,47 @@
+Name: sailfish-access-control-qt5
+Summary: Sailfish Access Control QML plugin
+Version: 0.0.1
+Release: 1
+License: LGPLv2+
+URL: https://git.sailfishos.org/mer-core/sailfish-access-control
+Source0: %{name}-%{version}.tar.bz2
+BuildRequires: pkgconfig(sailfishaccesscontrol) = %{version}
+BuildRequires: pkgconfig(Qt5Core)
+BuildRequires: pkgconfig(Qt5Qml)
+
+%description
+%{summary}.
+
+This library should be used to check whether a user
+belongs to a group or not.
+
+%package -n sailfish-access-control-qml-plugin
+Summary: Sailfish Access Control QML plugin
+Requires: sailfish-access-control = %{version}
+Requires(post): /sbin/ldconfig
+Requires(postun): /sbin/ldconfig
+
+%description -n sailfish-access-control-qml-plugin
+%{summary}.
+
+This library should be used to check whether a user
+belongs to a group or not.
+
+%prep
+%setup -q -n %{name}-%{version}/qt
+
+%build
+%qmake5
+
+%install
+rm -rf %{buildroot}
+
+%qmake5_install
+
+%post -n sailfish-access-control-qml-plugin -p /sbin/ldconfig
+
+%postun -n sailfish-access-control-qml-plugin -p /sbin/ldconfig
+
+%files -n sailfish-access-control-qml-plugin
+%defattr(-,root,root,-)
+%{_libdir}/qt5/qml/Sailfish/AccessControl
diff --git a/rpm/sailfish-access-control.spec b/rpm/sailfish-access-control.spec
index 3e42b47..525d123 100644
--- a/rpm/sailfish-access-control.spec
+++ b/rpm/sailfish-access-control.spec
@@ -26,7 +26,7 @@ Requires: %{name} = %{version}-%{release}
C language headers of the Sailfish Access Control library.
%prep
-%setup -q -n %{name}-%{version}
+%setup -q -n %{name}-%{version}/glib
%build
make ROOT=%{buildroot} %{_smp_mflags} VERSION=%{version}
diff --git a/sailfish-access-control.pro b/sailfish-access-control.pro
index c45b3f2..deccf93 100644
--- a/sailfish-access-control.pro
+++ b/sailfish-access-control.pro
@@ -1,10 +1,7 @@
# For QtCreator integration purposes. Not meant for building the project.
-TEMPLATE = aux
-
-HEADERS += sailfishaccesscontrol.h
-SOURCES += sailfishaccesscontrol.c
+TEMPLATE = subdir
+SUBDIRS = glib qt
OTHER_FILES += \
- Makefile \
- sailfishaccesscontrol.pc.tpl \
rpm/sailfish-access-control.spec \
+ rpm/sailfish-access-control-qt5.spec \