kuzzleio / kuzzle-plugin-sample-custom-policies

Example of advanced permission management with a Kuzzle plugin
Apache License 2.0
1 stars 0 forks source link
kuzzle kuzzle-plugin

Sample "custom policies" plugin for Kuzzle

This plugin demonstrates how we can use custom code to manage custom permissions.

How it works

Let's assume that we have an application in which we do not want to allow non-admin users to view, update or delete other user's items.

Update/delete queries

Run assertCanUpdate before the request:

search/count queries

Run addQueryFilter before the request:

get query

Run assertCanRead after the request:

mget query

Run filterMgetResult after the request:

Install

Clone this repository locally and make it accessible from the plugins/enabled directory relative to the Kuzzle installation directory. A common practice is to put the code of the plugin in plugins/available and create a symbolic link to it in plugins/enabled.

Note. If you are running Kuzzle within a Docker container, you will need to mount the local plugin installation directory as a volume in the container.

Please refer to the Guide for further instructions on how to install Kuzzle plugins.