Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8350215
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T08:14:56+00:00 2026-06-09T08:14:56+00:00

There is a catalog of items. Each item is located under categories. For each

  • 0

There is a catalog of items. Each item is located under categories. For each of the category we can have users with different privileges(admin, expert, user). When we add an item, we select the visibility:
(1) – visible for all
(2) – visible for only admins and experts of the category this item was posted
(3) – visible for all members of the category this item was posted
(0) – hidden for all (only the creator can sees).

Let say i have 500 items with the word “Keyboard” in title. Most of them are in different categories. Only 1 item of theses 500 has privacy – 2(visible for experts and admins for the category) and located under category “Logitech”. When i as an admin of “Logitech” category type “keyboard” in the search, i should see that the search found 500 items, and show me 10 of them. If just an ordinary user(not admin or expert), types “keyboard” in the search he will see, that the search found 499 items, and show him 10 of that 499 items.

Is to grab 20 items instead of 10 and to check the privacy of each of the item, and then show only 10 items in search results the only possible solution? But what if all of this 20 will be “hidden for the user”?

Thanks in advance for your responses.

Database sketch:

1)items[id, title, category_id, visibility]

2) categories:[id, title]

3) category_user[id, user_id, category_id, role(expert, admin, user)]

4) users[id, name]

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T08:14:57+00:00Added an answer on June 9, 2026 at 8:14 am

    Something like this might do the trick:

    SELECT i.*,c.*,cu.*u.*
    FROM items i,categories c, category_user cu, user u
    WHERE i.title LIKE '%$search%'
    AND i.category_id=c.id
    AND cu.category_id=c.id
    AND u.id=cu.user_id
    AND cu.role='expert'
    AND i.visibility=1
    

    Change cu.role and i.visbility according to userdata.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have 3 columns. <div id=catalog> <ul id=author> <li>Different Author names</li> .... </ul> <ul
In this scenario (your basic catalog), there are multiple <div> s, each containing an
I have the following section of code. Is there anyway that I can use
the same way you can do the following... <xsl:for-each select=catalog/cd[artist='Bob Dylan']> Can you do
I have an application that presents a sort of catalog of items in a
I go in and add items to a category for a bundled item. It
There are three files lay at с:/catalog. They are lib.dll, conf.ini,libImp.cpp. And I call
Soon I'll be working on catalog(php+mysql) that will have multilang content support. And now
I have some simple catalog products in Magento, so I have their SKUs &
I posted this question on the django-users list, but haven't had a reply there

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.