Commit Graph

12 Commits

Author SHA1 Message Date
Philip Withnall 6f09483b4c libmalcontent: Clarify nullability of MctManager:connection
It’s not.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-04-07 12:52:15 +01:00
Philip Withnall 6ba767029f session-limits: Add serialize and deserialize methods
See the previous commit; this is the same, but for session limits.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-03-19 09:42:25 +00:00
Philip Withnall cba851fc27 app-filter: Add serialize and deserialize methods
Add methods to serialise and deserialise the app filter, and use them to
replace the code in `MctManager` which was previously doing this. This
exposes the variant format for the app filter in the API (although the
format is described as ‘opaque’) so that user code can log it or store
it separately.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-03-18 10:40:27 +00:00
Philip Withnall ee7ed7dc35 libmalcontent: Add support for setting session limits
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-01-16 13:17:45 +00:00
Philip Withnall 5e49cb7831 libmalcontent: Add a SessionLimits interface for time-limited sessions
This is another extension interface on accountsservice which stores
information about time and usage limits on the user session. Currently,
only a ‘daily schedule’ limit (or no limit) is supported, but additional
types and combinations of limits can be supported in future.

The daily schedule limit allows using the computer between a certain
start time and end time each day (the same each day). The user will be
kicked out of their session when the end time is reached, if they
haven’t already logged out.

This includes the getters for the new data, polkit rules for accessing
it, and some documentation. Changes to `malcontent-client` to support
session limits, setters, and unit tests will all follow.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-01-16 13:17:45 +00:00
Philip Withnall 9dcaa10253 libmalcontent: Drop an unused variable
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-01-16 13:17:45 +00:00
Philip Withnall 300b5a624f libmalcontent: Move MctAppFilterError to MctManagerError
This isn’t an API break, as compatibility defines are in place; and the
error code values are the same, so it shouldn’t be an ABI break. The
string value of the error quark has changed, but nobody should be
comparing that against a value which hasn’t come out of libmalcontent,
so changing it should be OK.

This is along the same lines as the previous commit: we don’t need one
error domain per property of an `MctManager`, so reduce the potential
for future duplication by renaming it now.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-01-16 13:17:45 +00:00
Philip Withnall acf2738d56 libmalcontent: Rename flags types
If we have a flag type for getting and for setting every type of value
which can be stored on an `MctManager`, that will lead to a load of flag
types which all look identical.

Refactor the types so we only have one shared flags type for getters,
and one for setters.

Add compatibility defines so that this doesn’t break API. It’s not an
ABI break because the flag member values don’t change.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-01-16 13:17:45 +00:00
Philip Withnall 5f2d4046ea libmalcontent: Fix a minor typo in a comment
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-01-16 13:17:45 +00:00
Umang Jain b6b8873261 docs: Improve documentation of "app-filter-changed" signal 2019-06-18 19:23:17 +05:30
Philip Withnall 2048f0d483 libmalcontent: Add MctManager::app-filter-changed signal
This is emitted when the app filter for a given user changes.

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

https://gitlab.freedesktop.org/pwithnall/malcontent/issues/1
2019-04-24 13:45:59 +01:00
Philip Withnall 68ebe8b568 libmalcontent: Factor getting/setting app filter into a manager
Create a new MctManager object which is used as the anchor for getting
or setting MctAppFilters.

This changes the API naming around quite a bit, but doesn’t really
change its behaviour or functionality — see the tests for examples of
how little things change.

This is one step on the way to emitting a signal (from MctManager) when
a user’s parental controls change.

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

https://gitlab.freedesktop.org/pwithnall/malcontent/issues/1
2019-04-24 13:45:59 +01:00