Mir
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
24namespace mir { class Server; }
25namespace mir { namespace frontend { class SessionCredentials; } }
26
27namespace miral
28{
30{
31public:
32 ApplicationCredentials(mir::frontend::SessionCredentials const& creds);
33
34 pid_t pid() const;
35 uid_t uid() const;
36 gid_t gid() const;
37
38private:
39 ApplicationCredentials() = delete;
40
41 mir::frontend::SessionCredentials const& creds;
42};
43
45{
46public:
48 virtual ~ApplicationAuthorizer() = default;
51
52 virtual bool connection_is_allowed(ApplicationCredentials const& creds) = 0;
55 virtual bool screencast_is_allowed(ApplicationCredentials const& creds) = 0;