summaryrefslogtreecommitdiff
path: root/src/mongo/db/auth/authorization_manager.h
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2014-05-30 09:56:36 -0400
committerKaloian Manassiev <kaloian.manassiev@mongodb.com>2014-05-30 11:44:18 -0400
commit4edbe14669b7804180d8b58549e257ceb679bb1d (patch)
treea72389bb84137c11755fd4f55d7218f190b0456c /src/mongo/db/auth/authorization_manager.h
parentbee249ac8907cc9de6b19ba87c3fcb074d84b1a3 (diff)
downloadmongo-4edbe14669b7804180d8b58549e257ceb679bb1d.tar.gz
SERVER-13961 Pass LockState to DBWrite and DBRead directly
This is part of the changes to move LockState be part of OperationContext and not retrieved from TLS.
Diffstat (limited to 'src/mongo/db/auth/authorization_manager.h')
-rw-r--r--src/mongo/db/auth/authorization_manager.h18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/mongo/db/auth/authorization_manager.h b/src/mongo/db/auth/authorization_manager.h
index be11d634e83..c03e5b3eb66 100644
--- a/src/mongo/db/auth/authorization_manager.h
+++ b/src/mongo/db/auth/authorization_manager.h
@@ -53,6 +53,7 @@ namespace mongo {
class AuthzManagerExternalState;
class UserDocumentParser;
+ class OperationContext;
/**
* Internal secret key info.
@@ -164,7 +165,7 @@ namespace mongo {
* returns a non-OK status. When returning a non-OK status, *version will be set to
* schemaVersionInvalid (0).
*/
- Status getAuthorizationVersion(int* version);
+ Status getAuthorizationVersion(OperationContext* txn, int* version);
/**
* Returns the user cache generation identifier.
@@ -172,7 +173,7 @@ namespace mongo {
OID getCacheGeneration();
// Returns true if there exists at least one privilege document in the system.
- bool hasAnyPrivilegeDocuments() const;
+ bool hasAnyPrivilegeDocuments(OperationContext* txn) const;
/**
* Updates the auth schema version document to reflect that the system is upgraded to
@@ -281,7 +282,7 @@ namespace mongo {
*
* If the user does not exist, returns ErrorCodes::UserNotFound.
*/
- Status getUserDescription(const UserName& userName, BSONObj* result);
+ Status getUserDescription(OperationContext* txn, const UserName& userName, BSONObj* result);
/**
* Writes into "result" a document describing the named role and returns Status::OK(). The
@@ -324,7 +325,7 @@ namespace mongo {
* The AuthorizationManager retains ownership of the returned User object.
* On non-OK Status return values, acquiredUser will not be modified.
*/
- Status acquireUser(const UserName& userName, User** acquiredUser);
+ Status acquireUser(OperationContext* txn, const UserName& userName, User** acquiredUser);
/**
* Decrements the refcount of the given User object. If the refcount has gone to zero,
@@ -389,7 +390,8 @@ namespace mongo {
* On failure, returns a status other than Status::OK(). In this case, is is typically safe
* to try again.
*/
- Status upgradeSchemaStep(const BSONObj& writeConcern, bool* isDone);
+ Status upgradeSchemaStep(
+ OperationContext* txn, const BSONObj& writeConcern, bool* isDone);
/**
* Performs up to maxSteps steps in the process of upgrading the stored authorization data
@@ -404,7 +406,7 @@ namespace mongo {
* progress performing the upgrade, and the specific code and message in the returned status
* may provide additional information.
*/
- Status upgradeSchema(int maxSteps, const BSONObj& writeConcern);
+ Status upgradeSchema(OperationContext* txn, int maxSteps, const BSONObj& writeConcern);
/**
* Hook called by replication code to let the AuthorizationManager observe changes
@@ -448,7 +450,9 @@ namespace mongo {
* Fetches user information from a v2-schema user document for the named user,
* and stores a pointer to a new user object into *acquiredUser on success.
*/
- Status _fetchUserV2(const UserName& userName, std::auto_ptr<User>* acquiredUser);
+ Status _fetchUserV2(OperationContext* txn,
+ const UserName& userName,
+ std::auto_ptr<User>* acquiredUser);
/**
* True if access control enforcement is enabled in this AuthorizationManager.