Commit Graph

19 Commits

Author SHA1 Message Date
Philip Withnall affecd74b8 libeos-parental-controls: Add epc_app_filter_is_appinfo_allowed() API
This is a wrapper around the existing blacklist checking APIs which
binds them to specific keys in a #GAppInfo.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://phabricator.endlessm.com/T24017
2018-11-27 13:58:00 +00:00
Philip Withnall 244985f45f libeos-parental-controls: Support matching against flatpak app IDs
These are the app-specific part of a flatpak ref, and are what’s
available when you have a .desktop file, via the X-Flatpak key in the
.desktop file. For example, for a flatpak ref
‘app/org.gnome.Builder/x86_64/master’, the app ID is
‘org.gnome.Builder’. It makes sense that we’d want to match against app
IDs in some situations, since the user probably doesn’t care about the
architecture or branch of the app they want to proscribe.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://phabricator.endlessm.com/T24016
2018-11-14 15:17:18 +00:00
Philip Withnall 60a938de0e libeos-parental-controls: Support disallowing app installation entirely
This is a boolean preference which overrides the OARS values entirely if
FALSE.

This change breaks ABI for EpcAppFilterBuilder, but since that hasn’t
been used in any code we’ve shipped yet, that should be OK.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://phabricator.endlessm.com/T24457
2018-11-13 11:30:19 +00:00
Philip Withnall 3ccc508fb5 libeos-parental-controls: Add a getter for OARS sections from a filter
Allow the set of OARS sections set in a filter to be queried.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://phabricator.endlessm.com/T24024
2018-11-08 17:54:15 +00:00
Philip Withnall fa11d103d2 libeos-parental-controls: Use FindUserById for accountsservice objects
Instead of manually constructing the D-Bus object path representing a
user, call FindUserById to have accountsservice do it for us. For normal
users, this makes no difference. For system users (UID < 1000) or other
users which accountsservice considers uninteresting (see
user_classify_is_human() in user-classify.c in accountsservice), no
D-Bus objects are created for them automatically. Calling FindUserById
ensures that the object is created before its path is returned to us.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://phabricator.endlessm.com/T24302
2018-11-02 09:17:56 +00:00
Philip Withnall 3b4dbf7019 libeos-parental-controls: Add synchronous versions of methods
Refactor the asynchronous implementation to run the synchronous
implementation in a thread. The synchronous version seems to be what’s
needed for most callers.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://phabricator.endlessm.com/T24024
2018-10-31 11:01:44 +00:00
Philip Withnall f9feb4b8ff libeos-parental-controls: Fix the order of arguments in a docstring
Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://phabricator.endlessm.com/T24024
2018-10-31 11:01:16 +00:00
Philip Withnall c19b6a777f libeos-parental-controls: Add support for flatpak refs
As well as handling paths on the file system, we should allow flatpak
refs to be explicitly handled in the app filter.

Both refs and paths can be stored safely in the same app filter GStrv
because paths are always absolute and refs always start with ‘app/’ or
‘runtime/’.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://phabricator.endlessm.com/T24020
2018-10-25 15:16:31 +13:00
Philip Withnall 2a7d99c630 libeos-parental-controls: Add setter support for app filters
This includes some basic tests. Full test coverage has not yet been
achieved.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://phabricator.endlessm.com/T24025
2018-10-25 15:12:32 +13:00
Philip Withnall bf76bc3e4d libeos-parental-controls: Rename a callback function
Make it a bit clearer that it gets the bus purely for the getter method
for parental controls, which it is hard-coded to chain to.

This will clarify some later changes.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://phabricator.endlessm.com/T24025
2018-10-25 15:12:32 +13:00
Philip Withnall 42a3222651
libeos-parental-controls: Add a missing (type) annotation
Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://phabricator.endlessm.com/T24025
2018-10-17 10:47:09 -03:00
Philip Withnall d97630f9df
libeos-parental-controls: Clarify ownership of a struct member
Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://phabricator.endlessm.com/T24025
2018-10-17 10:47:03 -03:00
Georges Basile Stavracas Neto 55d213cfbc
Revert "T24025 Add setter support to the library" 2018-10-17 10:38:37 -03:00
Philip Withnall fbaf3c0460 libeos-parental-controls: Add setter support for app filters
This includes some basic tests. Full test coverage has not yet been
achieved.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://phabricator.endlessm.com/T24025
2018-10-12 16:47:59 +13:00
Philip Withnall 9fb1249432 libeos-parental-controls: Add a missing (type) annotation
Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://phabricator.endlessm.com/T24025
2018-10-12 16:47:33 +13:00
Philip Withnall 39627b777e libeos-parental-controls: Clarify ownership of a struct member
Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://phabricator.endlessm.com/T24025
2018-10-12 16:47:16 +13:00
Philip Withnall 1e3defccf2 accounts-service: Add support for oars-1.1
Even though I can’t find a single copy of the specification or how it
differs from oars-1.0; it allegedly exists.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://phabricator.endlessm.com/T23999
2018-10-11 15:15:46 +13:00
Philip Withnall 6cc9b9bb27 libeos-parental-controls: Add support for OARS filters
The OARS filter for a user will allow the administrator to define the
maximum levels of violence, alcohol, sex, location sharing, etc. that
apps may have in order for the user to be allowed to see them in app
listings or install them. Anything more intense will be hidden and
uninstallable.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://phabricator.endlessm.com/T23999
2018-10-09 23:24:25 +13:00
Philip Withnall fe0c597774 libeos-parental-controls: Initial implementation of library
This allows the app filter to be queried, and includes all the basic
parts of a shared library. Introspection and unit tests are to follow.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
https://phabricator.endlessm.com/T23859
2018-10-03 14:53:14 +01:00