Commit Graph

5 Commits

Author SHA1 Message Date
Philip Withnall 04705c079a session-limits: Add mct_session_limits_is_enabled() API
This is a high-level API to indicate whether parental controls are
‘enabled’ for the given user. It’s a mirror of
`mct_app_filter_is_enabled()`, and exposes the existing
`time_limit_enabled_out` argument of
`mct_session_limits_check_time_remaining()` more conveniently.

Includes tests.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-03-24 11:06:16 +00: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 93d18ed2a9 libmalcontent: Add type macros for boxed types
These were accidentally missed out before.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-02-03 17:29:17 +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