-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Is your feature request related to a problem? Please describe.
Following the same philosophy described in #41, when one executes a command mgc <context> <entity> <action> one expects to execute the given <action> for the corresponding <entities> in that <context>.
The <entity> kinds could be fully independent or they could be related through some relation. Suppose I have kinds entity_A and entity_B, and a relation R:entity_A->entity_B between them. In this case, while executing some <action> one has to explicitly states if it is compatible with the existing relation R, meaning that the existence of R is enough to conclude that, if mgc entity_A <action>, then mgc entity_B <action>.
Suppose now that R:entity_A->entity_B is a relation between two kinds and that the <action> acts only over entity_B. Via pullback one can define the same action over entity_A and, in that case, the <action> is naturally compatible with the relation R.
In the <context> of object-storage, the entities appear into two kinds: buckets and objects. Furthermore, there is a natural relation between R:objects->buckets them: objects belongs to buckets. So, for any given <action> in the context of object-storage, one has to ask if it is compatible with the belongs to relation.
The fact is that the action acl set is defined only for the entity buckets. So, unless explicit mention on the opposite, it pass to be defined in objects in a way that is compatible with the belongs to relation.
The conclusion is the following:
- if the semantic system underlying the context
object-storagewas coherent, then while executingmgc object-storage acl set --public-read/--private --dst bucketone should expect to change the access control not only for thebucket, but also for anyobjectbelonging to it.
It seems that this is not the case:
- the command
mgc object-storage buckets acl set --public-read/--private --dst bucketdoes not modify the state of theobjectsin thebucket, but only of thebucket.
In the current version 0.30.0 of mgc, if one wants to change the access control of an object one needs to execute mgc object-storage buckets acl set --public-read/--private --dst bucket/path/to/object. However:
- while this command corresponds to an
<action> over the instance of anobject, it is defined for the kindbuckets`, which produces the same type of contradiction described in [FEAT] - improvement in the object-storagepublic-urloption #41.
Describe the solution you'd like
To improve the points exposed above, I could suggest two approaches:
- to follow the typical construction of a semantic system by assuming that the command
mgc object-storage acl set --public-read/--private --dst bucketis be able to modify the state not only of the bucket, but also of its objects. - to maintain the atypical construction of the semantic system (meaning that
mgc object-storage acl set --public-read/--private --dst bucketwill still affect only the bucket) and, instead of creating the actionact setoverobjectsby pullbacks, define it explicitly (meaning that one should now pass to have the optionmgc object-storage objects acl set --public-read/--private --dst bucket/path/to/object). In that case, the help message for the commandmgc object-storage buckets acl setshould mention that the action affects only the bucket, indicating to the user how to execute the corresponding action for the entityobjects, if needed.
In my opinion, due its flexibility, the second option is the best solution.
OBS. As an additional improvement I could suggest to add the flag
--recursive/-Rto the optionmgc object-storage buckets acl set. With that flag, the action would pass to all objects (i.e, the action in objects would be that obtained by pullback).