~thomas-voss/location-service/export-docs-to-rtd

« back to all changes in this revision

Viewing changes to src/location/always_granting_permission_manager.h

  • Committer: Thomas Voß
  • Date: 2016-08-26 13:11:26 UTC
  • Revision ID: thomas.voss@canonical.com-20160826131126-jhvsl5waxgvnhzh0
Replay http://bazaar.launchpad.net/~phablet-team/location-service/trunk/revision/265.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright © 2016 Canonical Ltd.
 
3
 *
 
4
 * This program is free software: you can redistribute it and/or modify it
 
5
 * under the terms of the GNU Lesser General Public License version 3,
 
6
 * as 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 Lesser General Public License for more details.
 
12
 *
 
13
 * You should have received a copy of the GNU Lesser General Public License
 
14
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
15
 *
 
16
 * Authored by: Scott Sweeny <scott.sweeny@canonical.com>
 
17
 */
 
18
#ifndef LOCATION_ALWAYS_GRANTING_PERMISSION_MANAGER_H_
 
19
#define LOCATION_ALWAYS_GRANTING_PERMISSION_MANAGER_H_
 
20
 
 
21
#include <location/permission_manager.h>
 
22
 
 
23
namespace core { namespace dbus {
 
24
class Bus;
 
25
}}
 
26
 
 
27
namespace location
 
28
{
 
29
// A PermissionManager implementation which always returns granted since 
 
30
// permissions are handed by interfaces in Snappy
 
31
class AlwaysGrantingPermissionManager : public PermissionManager
 
32
{
 
33
public:
 
34
    AlwaysGrantingPermissionManager() = default;
 
35
 
 
36
    // From PermissionManager
 
37
    Result check_permission_for_credentials(const Criteria&, const Credentials&) override
 
38
    {
 
39
        return Result::granted;
 
40
    }
 
41
};
 
42
}
 
43
 
 
44
#endif // LOCATION_ALWAYS_GRANTING_PERMISSION_MANAGER_H_