Skip to content

Commit

Permalink
src: clarify the parameter name in Permission::Apply
Browse files Browse the repository at this point in the history
This fixes confusing parameter names. They are references
to set allow-permission.

Signed-off-by: Daeyeon Jeong <daeyeon.dev@gmail.com>
PR-URL: #47874
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Debadree Chatterjee <debadree333@gmail.com>
  • Loading branch information
daeyeon authored and targos committed May 12, 2023
1 parent e9c6ee7 commit 515c9b8
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/permission/child_process_permission.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace permission {

// Currently, ChildProcess manage a single state
// Once denied, it's always denied
void ChildProcessPermission::Apply(const std::string& deny,
void ChildProcessPermission::Apply(const std::string& allow,
PermissionScope scope) {
deny_all_ = true;
}
Expand Down
2 changes: 1 addition & 1 deletion src/permission/child_process_permission.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace permission {

class ChildProcessPermission final : public PermissionBase {
public:
void Apply(const std::string& deny, PermissionScope scope) override;
void Apply(const std::string& allow, PermissionScope scope) override;
bool is_granted(PermissionScope perm,
const std::string_view& param = "") override;

Expand Down
2 changes: 1 addition & 1 deletion src/permission/fs_permission.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace permission {

class FSPermission final : public PermissionBase {
public:
void Apply(const std::string& deny, PermissionScope scope) override;
void Apply(const std::string& allow, PermissionScope scope) override;
bool is_granted(PermissionScope perm, const std::string_view& param) override;

// For debugging purposes, use the gist function to print the whole tree
Expand Down
2 changes: 1 addition & 1 deletion src/permission/permission.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class Permission {
const std::string_view& res);

// CLI Call
void Apply(const std::string& deny, PermissionScope scope);
void Apply(const std::string& allow, PermissionScope scope);
void EnablePermissions();

private:
Expand Down
2 changes: 1 addition & 1 deletion src/permission/permission_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ enum class PermissionScope {

class PermissionBase {
public:
virtual void Apply(const std::string& deny, PermissionScope scope) = 0;
virtual void Apply(const std::string& allow, PermissionScope scope) = 0;
virtual bool is_granted(PermissionScope perm,
const std::string_view& param = "") = 0;
};
Expand Down
2 changes: 1 addition & 1 deletion src/permission/worker_permission.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace permission {

// Currently, PolicyDenyWorker manage a single state
// Once denied, it's always denied
void WorkerPermission::Apply(const std::string& deny, PermissionScope scope) {
void WorkerPermission::Apply(const std::string& allow, PermissionScope scope) {
deny_all_ = true;
}

Expand Down
2 changes: 1 addition & 1 deletion src/permission/worker_permission.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace permission {

class WorkerPermission final : public PermissionBase {
public:
void Apply(const std::string& deny, PermissionScope scope) override;
void Apply(const std::string& allow, PermissionScope scope) override;
bool is_granted(PermissionScope perm,
const std::string_view& param = "") override;

Expand Down

0 comments on commit 515c9b8

Please sign in to comment.