Copying a Policy with Permissions to a new Policy

Hi. I am currently facing difficulties creating policies for new roles as there is no Save as Copy feature for policies in v11.8.0. For each new role added, if the same policy rules apply but with different item permissions and same field permissions, I still have to create a new policy and add each collection permissions one by one. The project was upgraded from v10 to 11 so the policies were not designed per use case and all the collections put into one policy. Is there a way to automate this using the API or with SQL queries directly? Thanks in advance.

Yeah I agree the ability to copy an existing policy is a bit of a missing feature currently. I had the same problem!

There are API endpoints for Policy and Permissions though so you can pretty easily write a script to do this.

https://directus.io/docs/api/policies#list-policies

Thanks for the note! To @Burvs ‘ point above, there’s currently no way to duplicate a policy. I’ve jotted down your comment on our end so we’ll keep track of it as a feature request. Thanks!