Manage user permissions using groups in Matomo. This plugin adds a dedicated admin screen to manage groups, assign users to groups, and set site access for each group.
- Manage access by groups instead of per-user.
- Assign users to one or more groups.
- Grant or revoke site access for entire groups, including applying to all sites you administer.
- Two clear tabs: Manage Access and Manage Groups.
- Matomo: >= 5.0.0 (see
plugins/GroupPermissions/plugin.json) - PHP: as required by your Matomo version
- Copy the
GroupPermissionsdirectory into your Matomoplugins/folder so that it is available atplugins/GroupPermissions. - Activate the plugin:
- Via Matomo UI: Go to Administration → System → Plugins and enable "GroupPermissions".
- Or via CLI, from your Matomo root:
php console plugin:activate GroupPermissions php console core:clear-caches
- Go to Administration → System → Group Permissions.
- The page shows two tabs: "Manage Access" and "Manage Groups".
- Select the target website(s). You can apply changes to a specific site ID or to all sites you administer.
- For each group, choose one of the available roles for the selected site(s):
view,write, oradmin.
- Create, rename, and delete groups.
- Add or remove users to/from a group. A user can be in multiple groups.
- Duplicates are prevented; attempts to add an existing member will show an error.
- Managing group membership (create/rename/delete groups, add/remove users) requires Super User access.
- Changing site access for groups requires Admin access on the selected site(s).
Matomo exposes plugin APIs via HTTP. The following methods are available in Piwik\Plugins\GroupPermissions\API and can be called using the module=API&method= pattern:
- Get all groups:
index.php?module=API&method=GroupPermissions.getAllGroups&format=JSON&token_auth=YOUR_TOKEN - Get members of a group:
index.php?module=API&method=GroupPermissions.getMembersOfGroup&idGroup=1&format=JSON&token_auth=YOUR_TOKEN - Set group access for site(s):
index.php?module=API&method=GroupPermissions.setGroupAccess&name=Marketing&access=view&idSites=all&format=JSON&token_auth=YOUR_TOKEN
Notes:
- Use
idSites=allto apply to all sites you administer, oridSites=1,2,3for a list. - Valid access roles are those returned by Matomo's role provider (commonly
view,write,admin).
- Frontend is built with Vue 3 and
vue-multiselect. - If you build the Vue assets locally and encounter a TypeScript nullish chain issue, apply this temporary workaround in
node_modules/vue-multiselect:- Replace
if (this.$refs.list?.scrollTopwithif (this.$refs.list && this.$refs.list.scrollTop
- Replace
Typical steps:
cd plugins/GroupPermissions
npm install
# build steps depend on your environment; compiled assets are committed in vue/distContributions are welcome via pull requests on the repository homepage.
- Issues:
https://github.com/MichaelRoosz/plugin-GroupPermissions/issues - Source:
https://github.com/MichaelRoosz/plugin-GroupPermissions
GPL v3 or later. See the LICENSE.txt file for details.