# Can't Edit Category or Add Subcategories To It

**URL:** https://meta.discourse.org/t/cant-edit-category-or-add-subcategories-to-it/113645
**Category:** Support
**Created:** [April 6, 2019, 9:50pm UTC](https://meta.discourse.org/t/cant-edit-category-or-add-subcategories-to-it/113645 "2019-04-06T21:50:30Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Eingang](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eingang/32/98491_2.png) [@Eingang](https://meta.discourse.org/u/Eingang)
#### Post date: [April 6, 2019, 9:50pm UTC](https://meta.discourse.org/t/cant-edit-category-or-add-subcategories-to-it/113645/1 "2019-04-06T21:50:30Z")

</div>

## Summary

On editing a restricted parent category or trying to add a new subcategory to a parent category, server returns “422: Unprocessable Entity”

## Environment

- Currently v2.3.0.beta7 +7 but problem first noticed several weeks back after being told there was a major update (which may have needed to be installed via command line and not via web interface?)

- CentOS Linux release 7.6.1810

## Discussion

This may be related to [Unable to set up permissions on parent/subcategory](https://meta.discourse.org/t/unable-to-set-up-permissions-on-parent-subcategory/112562/5) and it’s definitely popped up fairly recently. As described in that post, I have a top-level category that is set for a group to _see_ only. It’s really a container for the subcategories. Unlike their setup, my `see` group isn’t `everyone`. It’s a specific group that encompasses all the members of the subcategory groups (who can see, reply, and create).

Unless I set the parent container now to include `everyone see`, if I try to add a subcategory to the parent or edit something about the parent, I inevitably will get a `422: Unprocessable Entity`. If I add `everyone see` into the parent category, it suddenly works.

I don’t have `everyone see` as a permission because sign-in is managed by OAUTH via another product. Anyone who can sign-in there _should not_ be able to see anything on my Discourse _unless_ they’re in a specific group, so I don’t use `everyone` almost anywhere.

I suspect I can add `everyone see` to the parent category to make changes/add new subcategories, and then remove it when I’m done. I’ll try testing that. In any case, the error message (which I also see pop up at other times) is particularly uninformative and the logs didn’t seem to show anything obvious I could see.

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [April 6, 2019, 10:15pm UTC](https://meta.discourse.org/t/cant-edit-category-or-add-subcategories-to-it/113645/2 "2019-04-06T22:15:41Z")

</div>

So if you add the same permissions as the parent prior to creation it fails?

---

<div class="post-metadata">

### Author: ![Eingang](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eingang/32/98491_2.png) [@Eingang](https://meta.discourse.org/u/Eingang)
#### Post date: [April 7, 2019, 12:05am UTC](https://meta.discourse.org/t/cant-edit-category-or-add-subcategories-to-it/113645/3 "2019-04-07T00:05:45Z")

</div>

Does this make it clearer?

- Parent category has `see` permissions for a group called `MyOwnEveryone`;
- Subcategory is being added with `create, reply, see` permissions for a group called `SomeGroup A`.
- `MyOwnEveryone` includes all members of `SomeGroup A`, `SomeGroup B`, `SomeGroup C`, etc, but _is not_ the predefined `everyone` group for reasons mentioned in my original post.

So Discourse fails to recognize that `SomeGroup B` is a subset of `MyOwnEveryone`. This isn’t completely surprising, I suppose, but it’s inconvenient, and it was working before. :-o

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [April 7, 2019, 1:25am UTC](https://meta.discourse.org/t/cant-edit-category-or-add-subcategories-to-it/113645/4 "2019-04-07T01:25:39Z")

</div>

That’s correct, Discourse doesn’t enumerate group memberships.

This is by design. Subcategories can’t have permissions that are less restrictive than their parents. A check was added for this during the recent betas:

> ✅ Do not allow saving a category if child permissions are **LESS** restrictive than parent: [Subcategories do not inherit permissions from parent category](https://meta.discourse.org/t/subcategories-do-not-inherit-permissions-from-parent-category/17174/20) @maja

Source: [Discourse 2.3 notes](https://meta.discourse.org/t/discourse-version-2-3/96690)

This is why I asked:

> [@Stephen](#):
>
> So if you add the same permissions as the parent prior to creation it fails?

It’s not a category creation error, you’re just using categories in a way that isn’t intended. Had you tried what I asked it would have worked.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [July 20, 2022, 8:55am UTC](https://meta.discourse.org/t/cant-edit-category-or-add-subcategories-to-it/113645/6 "2022-07-20T08:55:20Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
