-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
Expand file tree
/
Copy pathaddon_permission.cc
More file actions
30 lines (23 loc) · 794 Bytes
/
addon_permission.cc
File metadata and controls
30 lines (23 loc) · 794 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include "addon_permission.h"
#include <string>
namespace node {
namespace permission {
// Currently, Addon manage a single state
// Once denied, it's always denied
void AddonPermission::Apply(Environment* env,
const std::vector<std::string>& allow,
PermissionScope scope) {
deny_all_ = true;
}
void AddonPermission::Drop(Environment* env,
PermissionScope scope,
const std::string_view& param) {
deny_all_ = true;
}
bool AddonPermission::is_granted(Environment* env,
PermissionScope perm,
const std::string_view& param) const {
return deny_all_ == false;
}
} // namespace permission
} // namespace node