משתמש לא יכול ליצור נושא חדש ולתייג אותו במהלך היצירה - התגיות לא מופיעות

יש לי משתמש רגיל שהוא trust_level_0 ו-trust_level_1, ויש לי את ההגדרות האלה:

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

המשתמש יכול ליצור את הנושאים, אבל הוא לא יכול להשתמש בתגים כאשר הוא יוצר את הנושא. הוא יכול להשתמש בתגים לחיפוש אבל התגים לא מופיעים כאשר יוצרים נושא.

האם ההגדרה שלי שגויה? האם אני מפספס משהו? עם משתמש צוות או מנהל אני יכול לעשות את שניהם בבת אחת. תודה על כל עצה.

2 לייקים

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 לייקים

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 :

מישהו שנמצא ב-trust_level_1 גם נמצא ב-trust_level_0 כברירת מחדל.

3 לייקים

אתה אולי תרצה לאפשר ל-TL0 ליצור נושאים, תלוי בהגדרות האתר שלך, שכן אנשים לעיתים יירשמו כדי לשאול שאלה, וכו’ ועלולים להתבלבל מדוע הם לא יכולים (ואולי יוותרו לפני שיבינו את זה).

אבל אני לא חושב שזה יסביר את הבעיה שאתה חווה.

הבעיה מתרחשת רק אצל משתמש זה? האם אנשים אחרים מצליחים לתייג נושאים בהצלחה?

האם תוכל לספק פרטים נוספים על איך שהגדרת את התגים שלך?

כמו שהזכיר @HAWK, כל אחד שנמצא ב-trust_level_one הוא באופן אוטומטי ב-trust_level_0, ולכן זה מבלבל אותי. יש יותר ממשתמש אחד עם הבעיה הזאת. בדקתי את התגים שניתן להשתמש בהם בקטגוריות שדרושות לנו.

@JammyDodger, מה יכול להיות מעניין לבדוק בהגדרות התגים שלי?

לייק 1

תגיות גמישות מאוד ويمكن להיקבע בדרכים רבות so אולי נצטרך קצת יותר פרטים על איך הגדרת את שלך כדי לספק הצעות יותר ספציפיות.

אמנם דרך נפוצה היא כאשר קטגוריה הוגדרה לקיים תגים מסוימים בלבד שמותרים לשימוש באותה קטגוריה ו’לא לאפשר תגים נוספים’ לא נבדק. זה יכול להגביל את הקטגוריה לתגים המוגבלים בלבד ואם אותם הם של staff-only זה יכול למנוע מאחרים להשתמש בתגים אחרים.

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 לייקים

היי @JammyDodger ו-@HAWK. הייתי מסובך עם בעיות אחרות בעבודה אבל אני עדיין תקוע עם זה. Z

אוקיי, יש לי את הקטגוריות שלי, וב"הגדרות תגיות" של הקטגוריה יש לי:

הגבל את קבוצות התגיות האלה לקטגוריה זו: TAG-GRP1, TAG-GRP2

כשאני הולך ל"ניהול קבוצות תגיות" יש לי:

TAG-GRP1:

שם: TAG-GRP1
תגיות בקבוצה זו: רשימה של התגיות שלי עבור TAG-GRP1
תג אב: -
הגבל תג אחד לנושא מקבוצה זו (לא מסומן)

TAG-GRP2:

שם: TAG-GRP2
תגיות בקבוצה זו: רשימה של התגיות שלי עבור TAG-GRP2
תג אב: -
הגבל תג אחד לנושא מקבוצה זו (לא מסומן)

תגיות גלויות רק לקבוצות הבאות: admin, moderators, trust_level_0, trust_level_1

וכשאני בודק כמנהל מערכת את התג שאני רוצה להשתמש בו בעת יצירת נושא אני יכול לראות את זה:

תג זה שייך לקבוצות אלה: . ניתן להשתמש בו רק בקטגוריות אלה: TAG-GRP1, TAG-GRP2

כבר יש לי TL0 ו-TL1 ב-“קבוצות מורשות נושא תג” ו-“קבוצות מורשות ליצור נושא”. אבל עם משתמש רגיל TL1 אני לא יכול להשתמש בחלק מהתגיות.

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 לייקים

בודק את הקישור שהמלצת עליו. תודה.

לייק 1

שלום @JammyDodger, תודה על הקישור שפרסמת, חשבתי שהוא יכול לעזור לי. כבר בדקתי את הקישור ואני חושב שההגדרות שלי תקינות, ההמלצה בפוסט ההוא הגיונית לי, וההגדרות שלי כפי שהומלץ ואפשרתי לבדיקה את Also allow other tags בהגדרות הקטגוריה אבל למרבה הצער זה לא פתר את הבעיה שלי. אני תוהה אם אני צריך להפעיל מחדש “משהו” כאשר הגדרות ההרשאות משתנות.

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.

האם ייתכן שזה קשור לבעיה שתיארתי?

במידה כזו שאם המשתמש אינו יכול לגשת לקטגוריה, אז הוא לא יוכל לבחור אותה בעת יצירת נושא (ואם הם לא יכולים לבחור אותה בעת יצירת נושא, אז גם מבנה ‘התגית המותרת’ שלך לא יופעל). האם המשתמש חלק מקבוצה שיכולה לגשת לקטגוריות אלו?

אני חושב שאם עדיין לא הגעתם למהות הקונפליקט, ייתכן שתצטרכו להתחיל להסיר חלק ממגבלות התגיות ולראות אם אתם יכולים לצמצם בדיוק היכן מתרחש קונפליקט ההרשאות.

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.

זהו השאילתה שעזרה לי לזהות את הבעיה בתצורה שלי. עבר קצת זמן מאז שהשתמשתי בה, אז אני לא זוכר אם היה משהו שחשבתי לשפר.
ניתן לסנן לפי תג או קבוצת תגים

-- [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, ניסיתי את השאילתה בגרסה 3.5.0.beta8-dev והיא לא עבדה. קיבלתי את הודעת השגיאה הזו:

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

חיפשתי בגוגל את השגיאה הזו ומצאתי שאני צריך להגדיל את statement_timeout, אבל זה קורה בשרת פרודקשן ואני לא יודע הרבה על מסדי נתונים, PostgreSQL. אני מחפש איך לגרום לזה לעבוד בלי לקלקל את השרת.

לשם הסקרנות בלבד, ניסיתי את השאילתה עם חבר בפורום אחר שרץ על גרסה 3.4.0.beta1-dev והסקריפט רץ ללא בעיות ונראה שהוא עבד כשורה.