Hi Rui,
Thanks for your example and answer. It looks to be easy with this type of excluding. In my opinion it can be a good example for a single application which manages local configuration. I was thinking a bit about it and below you can find my thoughts.
In Bacularis, that is a network solution, regardless if Bacula configuration is local or remote, the communication goes through the API hosts. In the resource access matter this approach means that if we want to know to what jobs API host "AAA" is allowed, we ask this "AAA" host for that and "AAA" answers.
Now, remembering about it, when we look at these two lines:
$acls = getAcls("some_api_host"); // ["BBB"]
$jobs = getJobs(); // ["AAA","BBB","CCC"]
this is a place where we need two requests using two different API hosts:
getAcls("some_api_host")
uses API host some_api_host
getJobs()
uses the current administrative communication API host that user use
I have two worrying about it:
- if we have more hosts to update the access, it would mean iterating over API hosts for sending requests. In Bacularis we don't use this type of iterating.
- if the criteria to update access with excludes in host is the exclude flag and user will set this flag on API hosts which work with different Directors, it can cause that jobs from main host (
$jobs
) may not exists on these hosts. The same rule is for all hosts - if we want to know what resources this host have, we need to call it and ask it. We don't know what are resources on API host in advance.
I am still thinking about this idea and for now I am not seeing other ways than giving user a choice what API host settings he would like to update and what jobs to exclude (it can be a regular expression or static names).
Summing up, I don't see problem with your example, but I am seeing an implementation problem with fitting it to Bacularis.
What do you thing about it?
Best regards,
Marcin Haba (gani)