• Home
  • Categories
  • Recent
  • Popular
  • Top
  • Tags
  • Users
  • Groups
  • Documentation
    • Home
    • Read API
    • Write API
    • Plugin Development
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
v3.5.2 Latest
Buy Hosting

Restrict access on /users and /api/users if not logged

Scheduled Pinned Locked Moved Plugin Development
3 Posts 2 Posters 1.8k Views
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • marcelo-lopesM Offline
    marcelo-lopesM Offline
    marcelo-lopes
    wrote on last edited by
    #1

    Hi,

    I tried to find in nodebb code and admin, but I could not see any way to avoid not logged users to access the users search page and api.

    Is there a way to do it?

    Thanks a lot

    Marcelo

    pichaliteP 1 Reply Last reply
    0
  • pichaliteP Offline
    pichaliteP Offline
    pichalite Plugin & Theme Dev
    replied to marcelo-lopes on last edited by
    #2

    @marcelo-lopes you can turn off search for guests in ACP -> Settings -> Guests

    1 Reply Last reply
    0
  • marcelo-lopesM Offline
    marcelo-lopesM Offline
    marcelo-lopes
    wrote on last edited by
    #3

    @pichalite said in Restrict access on /users and /api/users if not logged:

    ACP -> Settings -> Guests

    Thanks @pichalite .
    Actually the guests can access the /users page and /api/users.
    The setting will hide the search fields, but they can see the page anyway and use the pagination to see the users.

    I've finally added this on my routeSetup:

    routeHelpers.setupPageRoute(
                router, '/users', middleware, [middleware.checkGlobalPrivacySettings, middleware.requireUser], usersController.index);
    

    and now I get the "Access denied" page that I wanted.

    Thanks for the help.

    1 Reply Last reply
    0

Copyright © 2023 NodeBB | Contributors
  • Login

  • Don't have an account? Register

  • Login or register to search.
Powered by NodeBB Contributors
  • First post
    Last post
0
  • Home
  • Categories
  • Recent
  • Popular
  • Top
  • Tags
  • Users
  • Groups
  • Documentation
    • Home
    • Read API
    • Write API
    • Plugin Development