Gebruiker kan geen nieuw onderwerp aanmaken en taggen tijdens het aanmaken - de tags worden niet weergegeven

I have a regular user that is trust_level_0 and trust_level_1 , and I have these settings:

tag topic allowed groups: admins, moderators, staff, trust_level_0
create topic allowed groups: admins, moderators, trust_level_1
create tag allowed groups: admins, moderators, staff

The user can create the topics, but he can not use tags when he is creating the topic. He can use the tags for search but the tags are not listed when creating a topic.

Is my setting incorrect? Am I missing something? Whit staff or admin user I can do both at once. Thanks for any advice.

2 likes

It has caught more than a few people out, but admin and mods can skip a lot of the restrictions that apply to everyone else.

Do you have any other restrictions placed on your tags? Like a tag group that only x group can use, or any restrictions you’ve placed on tags in a particular category?

If you go to a tag page and click the tag wrench (:information_source: for non-staff) it should show you some more information that may be able to help track any extra limitations you’ve placed on it. Eg broken here on meta:

2 likes

could be possible that Discourse is not handling the mix between trust_level_0 and trust_level_1 when creating the topic and tagging it?

Should I add trust_level_1 to this:

and add trust_level_0 in this line :

Anyone that is in trust_level_1 is also in trust_level_0 by default.

3 likes

You may want to allow TL0 to be able to create topics, depending on your site setup, as people will often sign up to ask a question, etc and could be confused as to why they can’t (possibly giving up before figuring it out).

But I don’t think this would explain the problem you’re having.

Is this issue happening for just this user? Are other people able to successfully tag topics?

Could you give any more detail about how you’ve set your tags up?

As @HAWK said, anyone that is in trust_level_one is by default in trust_level_0, and for that reason it’s confusing for me. There are more than one user with this problem.I checked tags that can be used in the Categories that we need.

@JammyDodger , what could be interesting to check in my tags set up?

1 like

Tags are pretty flexible and can be configured in lots of different ways so we may need some more detail on how you’ve set yours up to provide more specific suggestions.

Though a common one is when a category has been set up to have certain tags only allowed to be used in that category and the ‘also allow other tags’ hasn’t been checked. That could limit the category to only the restricted tags and if those ones are staff-only this could prevent anyone else from using any other tags.

Just to follow up (though hopefully you’ve already managed to track it down :crossed_fingers:), but Moin gave a thorough troubleshooting post for a similar thing here:

2 likes

Hallo @JammyDodger. Ik heb me met andere zaken op het werk beziggehouden, maar ik zit hier nog steeds mee vast. Z

OkĂ©, ik heb mijn CategorieĂ«n, en in de “Tags” instellingen van de categorie heb ik:

Beperk deze tag GROEPEN tot deze categorie: TAG-GRP1, TAG-GRP2

Wanneer ik naar “Tag Groepen Beheren” ga, heb ik:

TAG-GRP1:

Naam: TAG-GRP1
Tags in deze groep: EEN LIJST VAN MIJN TAGS VOOR TAG-GRP1
Ouder tag: -
Beperk één tag per onderwerp uit deze groep (niet aangevinkt)

TAG-GRP2:

Naam: TAG-GRP2
Tags in deze groep: EEN LIJST VAN MIJN TAGS VOOR TAG-GRP2
Ouder tag: -
Beperk één tag per onderwerp uit deze groep (niet aangevinkt)

Tags zijn alleen zichtbaar voor de volgende groepen: admin, moderators, trust_level_0, trust_level_1

En wanneer ik als Admin de tag controleer die ik wil gebruiken bij het aanmaken van een onderwerp, zie ik dit:

Deze tag behoort tot deze groepen: . Het kan alleen worden gebruikt in deze categorieën: TAG-GRP1, TAG-GRP2

Ik heb al TL0 en TL1 in “tag onderwerp toegestane groepen” en “onderwerp aanmaken toegestane groepen”. Maar met een reguliere gebruiker TL1 kan ik sommige tags niet gebruiken.

Did you manage to check out the troubleshooting post I linked above yet? It’s pretty thorough and could help point you in the right direction.

I’m not sure you’ve copied that over accurately?

Just as an extra FYI, there’s no need to put both TL0 and TL1 in any settings as all members of TL1 are also TL0 (think of TL0 as ‘all registered users’). Adding only TL0 would suffice. :+1:

2 likes

Ik bekijk de door jou aanbevolen link. Bedankt.

1 like

Hallo @JammyDodger , Bedankt voor de link die je hebt geplaatst, ik dacht dat het me zou kunnen helpen. Ik heb de link al gecontroleerd en ik denk dat mijn instellingen prima zijn, de aanbeveling in die post is logisch voor mij, en mijn instellingen zijn zoals aanbevolen en ik heb voor de test de optie Sta ook andere tags toe ingeschakeld in de categorie-instellingen, maar helaas heeft dit mijn probleem niet opgelost.

Ik vraag me af of ik iets opnieuw moet opstarten als de permissie-instellingen veranderen.

First, let me excuse for sharing this image with all the text blocked, I hope you can understand.

Those are the TAG name, the tag gruops name and categories where it’s supposed to be used but I can not use with my regular user. I would like to know if it is normal to have a padlock icon close to each category name.

Thank you guys for all of your help and ideas.

It’s normal when the category is not visible to everyone.
For example, this is one of my tags. You can see that there is a lock next to “Test”


And these are the security settings of that category:

“Everyone” has no “see” permission, that’s why the lock icon is shown next to the category badge. It indicates that this category is not public.

Zou dit iets te maken kunnen hebben met het probleem dat ik heb beschreven?

In zoverre dat als de gebruiker geen toegang heeft tot de categorie, deze deze niet kan selecteren bij het aanmaken van een onderwerp (en als ze deze niet kunnen kiezen bij het aanmaken van een onderwerp, zal uw ‘toegestane tag’-structuur ook niet van kracht worden). Maakt de gebruiker deel uit van een groep die toegang heeft tot die categorieĂ«n?

Ik denk dat als je nog niet weet wat het conflict is, je misschien enkele tagbeperkingen moet gaan verwijderen en moet kijken of je precies kunt achterhalen waar het permissieconflict plaatsvindt.

Do you have the Data Explorer plugin installed? I created a query that shows me all the limitations for a tag. Maybe that helps you too. You could perhaps even share the results and replace tag group names, tag names, and category names with other words in the output. Then it’s a little easier to help you than comparing black boxes.

Thank you @Moin . Yes, I do. I have Data Explorer plugin installed. Sorry for late reply again.

Dit is de query die me hielp het probleem in mijn configuratie te ontdekken. Het is alweer een tijdje geleden dat ik hem heb gebruikt, dus ik weet niet meer of er iets was waarvan ik dacht dat ik het zou verbeteren.

U kunt filteren op tag of taggroep

-- [params]
-- null string :tag_name
-- null string :tag_group

WITH allowed_tags AS (
  SELECT ct.category_id, t.id AS tag_id
  FROM category_tags ct
  JOIN tags t ON t.id = ct.tag_id
  UNION
  SELECT ctg.category_id, tgm.tag_id
  FROM category_tag_groups ctg
  JOIN tag_group_memberships tgm ON tgm.tag_group_id = ctg.tag_group_id
),

restricted_categories AS (
  SELECT c.id, c.name
  FROM categories c
  WHERE c.allow_global_tags = FALSE
    AND (
      EXISTS (SELECT 1 FROM category_tags ct WHERE ct.category_id = c.id)
      OR EXISTS (SELECT 1 FROM category_tag_groups ctg WHERE ctg.category_id = c.id)
    )
),

all_tag_category_combinations AS (
  SELECT t.id AS tag_id, t.name AS tag_name, rc.id AS category_id, rc.name AS category_name
  FROM tags t
  CROSS JOIN restricted_categories rc
  WHERE t.target_tag_id IS NULL
),

not_allowed_tags AS (
  SELECT atcc.tag_id, atcc.category_id, atcc.category_name
  FROM all_tag_category_combinations atcc
  LEFT JOIN allowed_tags al
    ON al.tag_id = atcc.tag_id AND al.category_id = atcc.category_id
  WHERE al.tag_id IS NULL
)

SELECT
  main.id AS tag_id,
  main.name AS tag_name,
  COALESCE(STRING_AGG(DISTINCT syn.name, ', '), '') AS synonyms,

  tg.id AS tag_group_id,
  COALESCE(parent_tag.name, '') AS parent_tag_name,
  CASE WHEN tg.one_per_topic THEN 'true' ELSE '' END AS one_tag_per_topic,

  COALESCE(
    STRING_AGG(
      DISTINCT
      CASE
        WHEN crtg.min_count IS NOT NULL THEN crtg_cat.name || ' (' || crtg.min_count || ')'
        ELSE NULL
      END,
      ', '
    ),
    ''
  ) AS required_in_categories_with_min,

  COALESCE(STRING_AGG(DISTINCT ctg_cat.name, ', '), '') AS tag_group_limited_to_category,
  COALESCE(STRING_AGG(DISTINCT ctags_cat.name, ', '), '') AS tag_limited_to_category,
  COALESCE(STRING_AGG(DISTINCT nat.category_name, ', '), '') AS not_allowed_in_categories,

  CASE
    WHEN COUNT(DISTINCT g.name) > 0 THEN COALESCE(STRING_AGG(DISTINCT g_use.name, ', '), '')
    ELSE ''
  END AS use_limited_to,
  COALESCE(STRING_AGG(DISTINCT g.name, ', '), '') AS view_only_groups

FROM tags AS main
LEFT JOIN tags AS syn ON syn.target_tag_id = main.id
LEFT JOIN tag_group_memberships AS tgm ON tgm.tag_id = main.id
LEFT JOIN tag_groups AS tg ON tg.id = tgm.tag_group_id
LEFT JOIN tags AS parent_tag ON parent_tag.id = tg.parent_tag_id
LEFT JOIN tag_group_permissions tgp ON tgp.tag_group_id = tg.id AND tgp.permission_type = 3
LEFT JOIN groups g ON g.id = tgp.group_id

LEFT JOIN category_required_tag_groups AS crtg ON crtg.tag_group_id = tg.id
LEFT JOIN categories AS crtg_cat ON crtg.category_id = crtg_cat.id
LEFT JOIN category_tag_groups AS ctg ON ctg.tag_group_id = tg.id
LEFT JOIN categories AS ctg_cat ON ctg.category_id = ctg_cat.id
LEFT JOIN category_tags AS ctags ON ctags.tag_id = main.id
LEFT JOIN categories AS ctags_cat ON ctags.category_id = ctags_cat.id
LEFT JOIN not_allowed_tags AS nat ON nat.tag_id = main.id
LEFT JOIN tag_group_permissions tgp_use ON tgp_use.tag_group_id = tg.id AND tgp_use.permission_type = 1
LEFT JOIN groups g_use ON g_use.id = tgp_use.group_id

WHERE
  main.target_tag_id IS NULL AND
  (
    :tag_name IS NULL OR
    LOWER(main.name) LIKE LOWER('%' || :tag_name || '%') OR
    LOWER(syn.name) LIKE LOWER('%' || :tag_name || '%')
  ) AND
  (
    :tag_group IS NULL OR
    LOWER(tg.name) LIKE LOWER('%' || :tag_group || '%')
  )

GROUP BY
  main.id, main.name, tg.id, tg.name, parent_tag.name, tg.one_per_topic
ORDER BY main.name, tag_group_id

@Moin, ik heb de query geprobeerd in versie 3.5.0.beta8-dev en het werkte niet. Ik kreeg deze foutmelding:

PG::QueryCanceled: ERROR:  canceling statement due to statement timeout

Ik heb deze foutmelding gegoogeld en ik heb gevonden dat ik statement_timeout moet verhogen, maar dit gebeurt op een productieserver en ik weet niet veel van databases, PostgreSQL. Ik kijk hoe ik het werkend kan krijgen zonder de server te verpesten.

Alleen uit nieuwsgierigheid heb ik de query geprobeerd met een vriend op een ander forum die versie 3.4.0.beta1-dev draait en het script werkte zonder problemen en het leek goed te werken.

bedankt voor je tijd en advies.