Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Try Vanilla Forums Cloud product

Giving only certain users access to a category using the API V2

Hello
I am trying to use the V2 api to make a category available only to certain users of the forum.
For this I think I have to create a role, add the users I want to view that category to that role, and set the read/write permissions on that role for that category.

  1. Does anyone have an example on how to do this using the API?

  2. Does anyone know another way to do this that can also be done using the API?

The problem is that the documentation doesn't have any example for this and is not very clear on how to do this.
In https://docs.vanillaforums.com/apiv2/swagger/#/Roles/patch_roles__id_ there is a permissions array, but I'm not sure what it should contain.
From the Model I understand it's a PermissionFragment that has
id
type
and
permissions* {
}

But again it's not very specific regarding the permissions format.

https://docs.vanillaforums.com/apiv2/swagger/#/Roles/patch_roles__id__permissions has even less information.

I noticed the v1 api you could set permissions directly for a category https://docs.vanillaforums.com/api/categories/ but I want to host the forum myself and v1 is only for the hosted solution.

I also you can set a group for a category, but I couldn't find any group functionality like describe in the documentation so I'm guessing it's a hosted only plugin.

Comments

Sign In or Register to comment.