Mir
include
miral
miral
application_authorizer.h
Go to the documentation of this file.
1
/*
2
* Copyright © Canonical Ltd.
3
*
4
* This program is free software: you can redistribute it and/or modify it
5
* under the terms of the GNU General Public License version 2 or 3 as
6
* published by the Free Software Foundation.
7
*
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
12
*
13
* You should have received a copy of the GNU General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
15
*/
16
17
#
ifndef
MIRAL_APPLICATION_AUTHORIZER_H
18
#
define
MIRAL_APPLICATION_AUTHORIZER_H
19
20
#
include
<
sys
/
types
.
h
>
21
#
include
<
functional
>
22
#
include
<
memory
>
23
24
namespace
mir
{
class
Server; }
25
namespace
mir
{
namespace
frontend
{
class
SessionCredentials; } }
26
27
namespace
miral
28
{
29
class
ApplicationCredentials
30
{
31
public
:
32
ApplicationCredentials
(
mir
::
frontend
::SessionCredentials
const
& creds);
33
34
pid_t
pid
()
const
;
35
uid_t
uid
()
const
;
36
gid_t
gid
()
const
;
37
38
private
:
39
ApplicationCredentials() =
delete
;
40
41
mir
::
frontend
::SessionCredentials
const
& creds;
42
};
43
44
class
ApplicationAuthorizer
45
{
46
public
:
47
ApplicationAuthorizer
() =
default
;
48
virtual
~
ApplicationAuthorizer
() =
default
;
49
ApplicationAuthorizer
(
ApplicationAuthorizer
const
&) =
delete
;
50
ApplicationAuthorizer
&
operator
=(
ApplicationAuthorizer
const
&) =
delete
;
51
52
virtual
bool
connection_is_allowed
(
ApplicationCredentials
const
& creds) = 0;
53
virtual
bool
configure_display_is_allowed
(
ApplicationCredentials
const
& creds) = 0;
54
virtual
bool
set_base_display_configuration_is_allowed
(
ApplicationCredentials
const
& creds) = 0;
55
virtual
bool
screencast_is_allowed
(
ApplicationCredentials
const
& creds) = 0;
56
virtual
bool
prompt_session_is_allowed
(
ApplicationCredentials
const