How to bulk change category permissions

(Stephen Chung) #1

Is there a way, via the Rails console or a rake task, to bulk-edit the permissions of categories?

In particular, I have a bunch of categories, currently set up for See permissions for group SomeGroup. Is there a command that I can run to change all permissions in all categories for SomeGroup to Reply/See without having to go into the UI and change each one of them by hand?

I can see in the PostgreSQL database that it is a simple number stored in permission_type under category_groups.

EDIT: There is no way to trick Data Explorer into executing a simple UPDATE statement because the whole thing is wrapped in a read-only transaction.

(Sam Saffron) #2

Absolutely no way of doing that… by design.

You can run SQL statements via a Rails console. But this stuff is just way to risky for me to be giving you recommendations here.

(Stephen Chung) #3

So is there a command at the console I can run to set this? Not too familiar with Rails to attempt it myself.