summaryrefslogtreecommitdiff
path: root/src/mongo/db/auth/role_graph.h
diff options
context:
space:
mode:
authorSara Golemon <sara.golemon@mongodb.com>2017-06-30 19:15:35 -0400
committerSara Golemon <sara.golemon@mongodb.com>2017-07-01 10:00:53 -0400
commitbe90e394a3a21ad38feed6d132e326bab27de5dd (patch)
tree8adea8592e160e43c049bbc1bf356b7400ac7000 /src/mongo/db/auth/role_graph.h
parentceb35c0db2ff109e6590028074162137c6d4add6 (diff)
downloadmongo-be90e394a3a21ad38feed6d132e326bab27de5dd.tar.gz
SERVER-29910 Make RoleGraph non-copyable (but movable)
Unrevert and apply MSVC workarounds.
Diffstat (limited to 'src/mongo/db/auth/role_graph.h')
-rw-r--r--src/mongo/db/auth/role_graph.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/mongo/db/auth/role_graph.h b/src/mongo/db/auth/role_graph.h
index 4d8334b7710..b04b97bc60c 100644
--- a/src/mongo/db/auth/role_graph.h
+++ b/src/mongo/db/auth/role_graph.h
@@ -56,6 +56,12 @@ class OperationContext;
*/
class RoleGraph {
public:
+ RoleGraph() = default;
+
+ // Explicitly make RoleGraph movable
+ RoleGraph(RoleGraph&&) = default;
+ RoleGraph& operator=(RoleGraph&&) = default;
+
/**
* Adds to "privileges" the privileges associated with the named built-in role, and returns
* true. Returns false if "role" does not name a built-in role, and does not modify
@@ -64,10 +70,6 @@ public:
*/
static bool addPrivilegesForBuiltinRole(const RoleName& role, PrivilegeVector* privileges);
- RoleGraph();
- RoleGraph(const RoleGraph& other);
- ~RoleGraph();
-
// Built-in roles for backwards compatibility with 2.2 and prior
static const std::string BUILTIN_ROLE_V0_READ;
static const std::string BUILTIN_ROLE_V0_READ_WRITE;
@@ -309,6 +311,8 @@ private:
std::set<RoleName> _allRoles;
};
-void swap(RoleGraph& lhs, RoleGraph& rhs);
+inline void swap(RoleGraph& lhs, RoleGraph& rhs) {
+ lhs.swap(rhs);
+}
} // namespace mongo