mirror of
https://github.com/OpenNebula/one.git
synced 2024-12-27 03:21:29 +03:00
Feature #1112: Set group_u to 1 for new DS. DS 'default' other_u is also set to 1
This commit is contained in:
parent
25460dd995
commit
a1af3ec165
@ -87,16 +87,6 @@ AclManager::AclManager(SqlDB * _db) : db(_db), lastOID(-1)
|
||||
PoolObjectSQL::HOST,
|
||||
AuthRequest::MANAGE,
|
||||
error_str);
|
||||
|
||||
// Users in USERS can use the default DATASTORE
|
||||
// @1 DATASTORE/#1 USE
|
||||
add_rule(AclRule::GROUP_ID |
|
||||
1,
|
||||
AclRule::INDIVIDUAL_ID |
|
||||
1 | // TODO: use DatastorePool::DEFAULT_DS_ID
|
||||
PoolObjectSQL::DATASTORE,
|
||||
AuthRequest::USE,
|
||||
error_str);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -49,6 +49,8 @@ Datastore::Datastore(
|
||||
tm_mad(""),
|
||||
base_path("")
|
||||
{
|
||||
group_u = 1;
|
||||
|
||||
if (ds_template != 0)
|
||||
{
|
||||
obj_template = ds_template;
|
||||
|
@ -44,6 +44,7 @@ DatastorePool::DatastorePool(SqlDB * db):
|
||||
if (get_lastOID() == -1) //lastOID is set in PoolSQL::init_cb
|
||||
{
|
||||
DatastoreTemplate * ds_tmpl;
|
||||
Datastore * ds;
|
||||
|
||||
int rc;
|
||||
|
||||
@ -110,6 +111,18 @@ DatastorePool::DatastorePool(SqlDB * db):
|
||||
goto error_bootstrap;
|
||||
}
|
||||
|
||||
ds = get(rc, true);
|
||||
|
||||
ds->set_permissions(
|
||||
-1,-1,-1,
|
||||
-1,-1,-1,
|
||||
1,-1,-1,
|
||||
error_str);
|
||||
|
||||
update(ds);
|
||||
|
||||
ds->unlock();
|
||||
|
||||
// User created datastores will start from ID 100
|
||||
set_update_lastOID(99);
|
||||
}
|
||||
|
@ -115,7 +115,7 @@ module Migrator
|
||||
" <OWNER_U>1</OWNER_U>" <<
|
||||
" <OWNER_M>1</OWNER_M>" <<
|
||||
" <OWNER_A>0</OWNER_A>" <<
|
||||
" <GROUP_U>0</GROUP_U>" <<
|
||||
" <GROUP_U>1</GROUP_U>" <<
|
||||
" <GROUP_M>0</GROUP_M>" <<
|
||||
" <GROUP_A>0</GROUP_A>" <<
|
||||
" <OTHER_U>0</OTHER_U>" <<
|
||||
@ -141,7 +141,7 @@ module Migrator
|
||||
:uid => 0,
|
||||
:gid => 0,
|
||||
:owner_u => 1,
|
||||
:group_u => 0,
|
||||
:group_u => 1,
|
||||
:other_u => 0)
|
||||
|
||||
# Last oid for cluster_pool and datastore_pool
|
||||
@ -272,7 +272,7 @@ module Migrator
|
||||
" <OWNER_U>1</OWNER_U>" <<
|
||||
" <OWNER_M>1</OWNER_M>" <<
|
||||
" <OWNER_A>0</OWNER_A>" <<
|
||||
" <GROUP_U>0</GROUP_U>" <<
|
||||
" <GROUP_U>1</GROUP_U>" <<
|
||||
" <GROUP_M>0</GROUP_M>" <<
|
||||
" <GROUP_A>0</GROUP_A>" <<
|
||||
" <OTHER_U>0</OTHER_U>" <<
|
||||
@ -298,7 +298,7 @@ module Migrator
|
||||
:uid => 0,
|
||||
:gid => 0,
|
||||
:owner_u => 1,
|
||||
:group_u => 0,
|
||||
:group_u => 1,
|
||||
:other_u => 0)
|
||||
|
||||
return true
|
||||
|
Loading…
Reference in New Issue
Block a user