Molybden API
Loading...
Searching...
No Matches
permissions.hpp
1// Copyright (c) 2000-2023 TeamDev Ltd. All rights reserved.
2// TeamDev PROPRIETARY and CONFIDENTIAL.
3// Use is subject to license terms.
4
5#ifndef MOLYBDEN_PERMISSIONS_HPP
6#define MOLYBDEN_PERMISSIONS_HPP
7
8#include <memory>
9
10#include "molybden/permission/permissions_delegates.hpp"
11
12namespace molybden {
13
14class Profile;
15
19enum class PermissionType {
20 kUnspecified,
21 kNotifications,
22 kGeolocation,
23 kAudioCapture,
24 kVideoCapture,
28 kClipboardReadWrite,
29 kProtectedMediaIdentifier,
30 kMidi,
31 kMidiSysex,
32 kDurableStorage,
33 kBackgroundSync,
38 kSensors,
45 kAccessibilityEvents,
46 kClipboardSanitizedWrite,
51 kLocalFonts
52};
53
57enum class PermissionStatus { kGranted, kDenied, kAsk };
58
63 public:
67 virtual std::shared_ptr<Profile> profile() = 0;
68
72 virtual PermissionStatus getPermissionStatus(PermissionType permission_type,
73 const std::string& url) = 0;
74
78 virtual void resetPermission(PermissionType permission_type,
79 const std::string& url) = 0;
80};
81} // namespace molybden
82
83#endif // MOLYBDEN_PERMISSIONS_HPP
A class that contains all permission delegates.
Definition permissions_delegates.hpp:71
Allows managing permissions.
Definition permissions.hpp:62
virtual std::shared_ptr< Profile > profile()=0
The profile of this service.
virtual void resetPermission(PermissionType permission_type, const std::string &url)=0
Sets the permission back to its default for the given URL.
virtual PermissionStatus getPermissionStatus(PermissionType permission_type, const std::string &url)=0
Returns the permission status for the given URL.