Change in ovirt-engine[ovirt-engine-4.1]: restapi: Set 'filter=true' by default for non admins
Code Review
gerrit at ovirt.org
Wed Mar 1 21:43:47 UTC 2017
>From Tal Nisan <tnisan at redhat.com>:
Tal Nisan has submitted this change and it was merged.
Change subject: restapi: Set 'filter=true' by default for non admins
......................................................................
restapi: Set 'filter=true' by default for non admins
The API supports the 'filter' parameter to indicate if results should be
filtered according to the permissions of the user. Due to the way this
is implemented, non admin users need to set this parameter for almost
all operations, as the default value is 'false'. To simplify things for
non admin users, this patch changes the default value to 'true', but
only for non admin users. If the value is explicitly given in a request
it will be honored.
This is a backwards compatibility breaking change, as clients that used
non admin users and did *not* provide explicitly the 'filter' parameter
will start to behave differently. However, this is unlikely, as calls
from non admin users without the 'filter=true' is almost useless. For
those unlikely cases where this may be a problem, the patch also
introduces a new 'ENGINE_API_FILTER_BY_DEFAUL' configuration parameter:
#
# This flags indicates if 'filtering' should be enabled by default for
# users that aren't administartors.
#
ENGINE_API_FILTER_BY_DEFAULT="true"
If it is necessary to revert to the behaviour of previous versions of the
engine, it can be achieved by changing this parameter in a configuration
file inside the '/etc/ovirt-engine/engine.conf.d' directory. For
example:
# echo 'ENGINE_API_FILTER_BY_DEFAULT="true"' > \
/etc/ovirt-engine/engine.conf.d/99-filter-by-default.conf
# systemctl restart ovirt-engine
Change-Id: I14d2e1101c32727f880ca8c82d48eb65fca9b8c2
Related-To: https://bugzilla.redhat.com/1420310
Bug-Url: https://bugzilla.redhat.com/1427987
Signed-off-by: Juan Hernandez <juan.hernandez at redhat.com>
(cherry picked from commit 233e85a1a6ba26ce98a7ea6325c83db4c6abd977)
---
M backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/LocalConfig.java
M backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BaseBackendResource.java
M backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/util/ParametersHelper.java
M packaging/services/ovirt-engine/ovirt-engine.conf.in
4 files changed, 33 insertions(+), 5 deletions(-)
Approvals:
Martin Peřina: Looks good to me, approved
Juan Hernandez: Verified
Jenkins CI: Passed CI tests
--
To view, visit https://gerrit.ovirt.org/73396
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I14d2e1101c32727f880ca8c82d48eb65fca9b8c2
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-4.1
Gerrit-Owner: Juan Hernandez <juan.hernandez at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Juan Hernandez <juan.hernandez at redhat.com>
Gerrit-Reviewer: Martin Peřina <mperina at redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski at gmail.com>
Gerrit-Reviewer: Tal Nisan <tnisan at redhat.com>
More information about the Engine-commits
mailing list