mirror of
https://github.com/OpenNebula/one.git
synced 2026-12-02 13:16:48 +09:00
* This commit syncs oned and API specification for the ALL flag. The internal defines were not consistent with the API specification.
This commit is contained in:
1 parent
9959ceac06
commit
82d2191dfd
6 files changed
+52
-14
No files matched your search
@@ -587,13 +587,22 @@ bool PoolObjectSQL::name_is_valid(const string& obj_name,
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
int PoolObjectSQL::lock_db(const int owner, const int req_id, const int level)
|
||||
int PoolObjectSQL::lock_db(const int owner,
|
||||
const int req_id,
|
||||
const int level,
|
||||
const bool is_admin)
|
||||
{
|
||||
if ( level < ST_NONE || level > ST_ADMIN )
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (locked != ST_NONE && lock_owner != owner && !is_admin)
|
||||
{
|
||||
// Only admin can override lock
|
||||
return -1;
|
||||
}
|
||||
|
||||
locked = static_cast<LockStates>(level);
|
||||
lock_time = time(0);
|
||||
lock_owner = owner;
|
||||
|
||||
Reference in new issue
Block a user