1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-12 09:18:10 +03:00

s4-dsdb: added dsdb_module_am_system()

better than each module inventing their own
This commit is contained in:
Andrew Tridgell 2010-01-08 09:29:01 +11:00
parent d22a9e5d3b
commit f118f54ee7

View File

@ -26,6 +26,7 @@
#include "dsdb/samdb/ldb_modules/util.h"
#include "dsdb/samdb/samdb.h"
#include "util.h"
#include "libcli/security/security.h"
/*
add a set of controls to a ldb_request structure based on a set of
@ -629,3 +630,11 @@ int dsdb_module_set_integer(struct ldb_module *module, struct ldb_dn *dn,
talloc_free(msg);
return ret;
}
bool dsdb_module_am_system(struct ldb_module *module)
{
struct ldb_context *ldb = ldb_module_get_ctx(module);
struct auth_session_info *session_info
= (struct auth_session_info *)ldb_get_opaque(ldb, "sessionInfo");
return security_session_user_level(session_info) == SECURITY_SYSTEM;
}