mirror of
https://github.com/nodejs/node.git
synced 2026-11-21 12:59:16 -05:00
src: apply minor namespace format tweak in permissions
Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/65158 Reviewed-By: Xuguang Mei <meixuguang@gmail.com> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
This commit is contained in:
1 parent
d157b005d4
commit
dee1fe76a0
2 files changed
+10
-15
No files matched your search
@@ -5,9 +5,7 @@
|
||||
|
||||
#include "permission/permission_base.h"
|
||||
|
||||
namespace node {
|
||||
|
||||
namespace permission {
|
||||
namespace node::permission {
|
||||
|
||||
// A simple boolean permission that either denies or allows access.
|
||||
// Used for permission scopes that don't need per-resource granularity.
|
||||
@@ -46,9 +44,7 @@ using DenyOnlyPermission = BooleanPermission<true>;
|
||||
// Apply grants access, Drop revokes.
|
||||
using AllowRevokePermission = BooleanPermission<false>;
|
||||
|
||||
} // namespace permission
|
||||
|
||||
} // namespace node
|
||||
} // namespace node::permission
|
||||
|
||||
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
|
||||
#endif // SRC_PERMISSION_BOOLEAN_PERMISSION_H_
|
||||
@@ -7,9 +7,7 @@
|
||||
#include "permission/permission_base.h"
|
||||
#include "util.h"
|
||||
|
||||
namespace node {
|
||||
|
||||
namespace permission {
|
||||
namespace node::permission {
|
||||
|
||||
class FSPermission final : public PermissionBase {
|
||||
public:
|
||||
@@ -125,9 +123,12 @@ class FSPermission final : public PermissionBase {
|
||||
// Handle optional trailing
|
||||
// path = /home/subdirectory
|
||||
// child = subdirectory/*
|
||||
if (idx >= path.length() &&
|
||||
child->prefix[i] == node::kPathSeparator) {
|
||||
continue;
|
||||
if (idx >= path.length()) {
|
||||
if (child->prefix[i] == node::kPathSeparator) {
|
||||
continue;
|
||||
}
|
||||
// Path is exhausted but prefix expects more characters
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (path[idx++] != child->prefix[i]) {
|
||||
@@ -185,9 +186,7 @@ class FSPermission final : public PermissionBase {
|
||||
bool allow_all_out_ = false;
|
||||
};
|
||||
|
||||
} // namespace permission
|
||||
|
||||
} // namespace node
|
||||
} // namespace node::permission
|
||||
|
||||
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
|
||||
#endif // SRC_PERMISSION_FS_PERMISSION_H_
|
||||
Reference in new issue
Block a user