mirror of
https://github.com/OpenNebula/one.git
synced 2025-01-11 05:17:41 +03:00
feature #3494: Persistent images can set use permission for group. Note that just one VM can use a persistent image at a time
This commit is contained in:
parent
f2c71cfded
commit
1f032c2d83
@ -373,34 +373,6 @@ public:
|
||||
return it->is_saving_hot();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set permissions for the Image. Extends the PoolSQLObject method
|
||||
* by checking the persistent state of the image.
|
||||
*/
|
||||
int set_permissions(int _owner_u,
|
||||
int _owner_m,
|
||||
int _owner_a,
|
||||
int _group_u,
|
||||
int _group_m,
|
||||
int _group_a,
|
||||
int _other_u,
|
||||
int _other_m,
|
||||
int _other_a,
|
||||
string& error_str)
|
||||
{
|
||||
if ( isPersistent() && (_group_u == 1 || _other_u == 1) )
|
||||
{
|
||||
error_str = "Image cannot be public and persistent.";
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
return PoolObjectSQL::set_permissions(_owner_u, _owner_m, _owner_a,
|
||||
_group_u, _group_m, _group_a,
|
||||
_other_u, _other_m, _other_a,
|
||||
error_str);
|
||||
};
|
||||
|
||||
/**
|
||||
* Set/Unset an image as persistent
|
||||
* @param persistent true to make an image persistent
|
||||
@ -428,11 +400,6 @@ public:
|
||||
case DELETE:
|
||||
if (persis == true)
|
||||
{
|
||||
if ( isPublic() )
|
||||
{
|
||||
goto error_public;
|
||||
}
|
||||
|
||||
persistent_img = 1;
|
||||
}
|
||||
else
|
||||
@ -451,10 +418,6 @@ public:
|
||||
|
||||
goto error_common;
|
||||
|
||||
error_public:
|
||||
error_str = "Image cannot be public and persistent.";
|
||||
goto error_common;
|
||||
|
||||
error_common:
|
||||
return -1;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user