How to define custom permissions for staff, admins, moderators

Sorry old post but why don’t you set up your theme as a repo in GitHub? Permission your design and UX team to have access to update the Theme in GitHub.

In Discourse you can now set Themes to auto update upon rebuild.

Your admins will now only need to rebuild to bring in any changes made by the Design and UX team and the latter will not need access to admin at all.

1 me gusta

Just a short note:

When coding matters of access control, in general, these RBAC checks should be performed on the server side.

RBAC code in client-side Javascript can be manipulated by the client.

This means that when defining core RBAC permissions for staff, admins and moderators, this should be done (generally speaking) in Rails, not in Javascript.

OBTW, this is also how Discourse does RBAC now, using what Discourse calls “guardian”, a Ruby class called class Guardian, here:

https://github.com/discourse/discourse/blob/master/lib/guardian.rb

If a developer is going to add RBAC checks in Javascript code by calling the Discourse API, keep in mind that this code can be compromised because code which runs in the browser can be manipulated.

My recommendation is to make sure all core RBAC code is performed on the server side and do not try to short cut this in client-side Javascript.

1 me gusta

There is also trust level 4 and category moderators, in discourse 2.5 and beyond.

1 me gusta

I have a similar use case, in that I run a small non-profit community where one of our users is maintaining the themes and design.

I do not wish to give anyone beside me and my co-owner access to private user data (e-mail addresses etc.), but I do have 4 moderators.

In order for the designer to work, I’ve had to create a copy site with no content where he is the admin, and I then copy themes and components manually. However it is not desirable since some changes requires content in order to proof.

2 Me gusta

Why not add some content to the staging / testing site? That’d be the typical recommendation.

So let the developer develop on the staging site, and push the themes to github. But you’ll still need to upgrade them yourself. You might contrive to do the upgrade with the API and somehow make the developer be able to trigger it.

I’m working of a tool that might be able to help with that.

1 me gusta

Nosotros tenemos exactamente esta misma necesidad, ¿alguien ha resuelto esto por casualidad?

No sé si esto es útil en esta situación, pero si solo necesitas algo de contenido, existe la tarea populate de rake:

1 me gusta

Gracias, desafortunadamente no es realmente útil en este momento.

1 me gusta

Si no confías en que el diseñador vea tus datos, ¿qué solución te imaginarías?
¿Podrías darle solo una clave de API que le permitiera usar el discourse_cli para enviarlo allí y luego deshabilitarla cuando haya terminado, tal vez?

1 me gusta

No hay absolutamente ninguna razón para que un diseñador tenga acceso a 100.000 usuarios, lol. Además, iría en contra de las normas del RGPD. ¿Es posible dar una clave de CLI solo para las actualizaciones de temas?

2 Me gusta

¡Disculpe! Creo que tiene razón.

Ahora, a diferencia de cuando se creó este tema (que aparentemente era donde estaba mi cerebro cuando escribí mi respuesta), tenemos claves de API granulares. No debería ser muy difícil agregar un nuevo ámbito solo para la gestión de temas.

Podría valer la pena crear un nuevo tema en Feature solicitando un ámbito de clave de API para desarrolladores de temas. Esa parece una buena idea.

3 Me gusta

No, no lo es. Puede ir en contra de las normas de ese sitio, pero estas pueden y deben cambiar.

2 Me gusta

Sería bueno si @AV_C pudiera publicar una referencia a este requisito. Aunque puedo apreciar enormemente por qué un cliente querría restringir el acceso a la base de usuarios e incluso a categorías privadas debido a una variedad de razones. El administrador completo puede acceder a los correos electrónicos de registro de los miembros y las categorías privadas pueden contener otro contenido sensible dependiendo del caso de uso del cliente.

Creo que @pfaffman tiene una buena idea para garantizar que este tipo de brecha pueda cubrirse a través de una API de administrador restringida. Una vez completado el trabajo de diseño, la clave se puede revocar hasta que sea necesaria.

Esto también encajaría con la idea de Jay de no mostrar a un usuario como administrador en la página Acerca de.

1 me gusta