# How to import category with category permissions?

**URL:** <https://meta.discourse.org/t/how-to-import-category-with-category-permissions/311197>\
**Category:** Migration\
**Tags:** rake-task\
**Created:** [June 7, 2024, 11:51am UTC](https://meta.discourse.org/t/how-to-import-category-with-category-permissions/311197 "2024-06-07T11:51:42Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![pacharanero](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pacharanero/32/500583_2.png) [@pacharanero](https://meta.discourse.org/u/pacharanero)\
**Post date:** [June 7, 2024, 3:13pm UTC](https://meta.discourse.org/t/how-to-import-category-with-category-permissions/311197/3 "2024-06-07T15:13:41Z")

</div>

Thanks @pfaffman for the rapid response!

Actually, it looks like this was just my dim-wittedness front and centre here.

The default behaviour of the `import:file` rake task (which invokes `ImportExport::Importer`) is **to copy exactly the permissions over from the source Category**. I only found this out from looking over the [source code](https://github.com/discourse/discourse/blob/main/lib/import_export/importer.rb#L79).

And it did exactly this. The reason my destination category didn’t have the permissions I had been hoping for was that I had forgotten to set those permissions correctly in the source! I was moving a category in an already _private_ forum (entire forum is private so that category was See/Reply/Create to Everyone in there) into a more open forum (in which those posts needed to be in a secure category - See/Reply/Create for Admins only initially)

> [@pfaffman](#):
>
> Having it default to staff only seems like a reasonable feature request or maybe a PR.

I agree - since Category import is something that can only really be done in the real live environment, one might want the permissions to default to admin-only until the import has been checked and everyone is satisfied it’s OK. Better that than spamming users with notifications about bulk imports.

---

_[View the full topic](https://meta.discourse.org/t/how-to-import-category-with-category-permissions/311197)._
