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 8601677
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T01:53:58+00:00 2026-06-12T01:53:58+00:00

I found this library for creating an ACL (access control list) for mongoose: https://github.com/scttnlsn/mongoose-acl

  • 0

I found this library for creating an ACL (access control list) for mongoose:
https://github.com/scttnlsn/mongoose-acl

It looks like a good module, but I’m a little confused on how to use it for my purpose.

I have a site where anybody (logged in or not) can visit a profile page, like example.com/users/chovy

However if the user ‘chovy’ is logged into this page, I want to give them admin privileges for editing the details of the account.

If the user is not ‘chovy’ or is not logged in, they would just see the read-only profile page for ‘chovy’.

Can someone give me a concrete example of how I would do this?

  • 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-12T01:54:00+00:00Added an answer on June 12, 2026 at 1:54 am

    That sounds so common, that I don’t think you need an ACL. You will need to have sessions, and then you can change how the view looks based upon the current logged in user. An incomplete example would like like this:

    // Assumes:
    // - You set req.session.user when user logs in
    // - The url route has a :name so you can do req.param() to get the name of the page being viewed
    
    db.users.getCurrentUser(req.session.user, gotLoggedInUser)
    db.users.getUserByName({name: req.param('name')}, gotUser)
    

    And then pass this to the view, when you do a res.render():

    var is_viewing_own_page = currentUser._id.toString() === loggedInUser._id.toString()
    

    And then the view can do something like this (assuming jade):

    - if (is_viewing_own_page)
      div You are looking at your own page
    - else
      div You are viewing someone else's page
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am learning how to draw GUI's with GDI/GDI+, i found this http://msdn.microsoft.com/en-us/library/windows/desktop/dd756596(v=vs.85).aspx#step_2__declare_that_the_application_is_dpi-aware Does
I found this library and liked it. Know i am searching info how to
I'm trying to authenticate user accounts in Windows Phone. I found this C# library
I'm trying to learn the Enterprise Library. I found this useful code sample to
This is from a small library that I found online: const char* GetHandStateBrief(const PostFlopState*
This morning we found an old chunk of code that was causing a library
When creating a form using three20 components with the methodology found in this example
I am creating a simple application to get familiar with SlimDX library. I found
. I found sample called Creating a COM Server Using a Text Editor in
Note: I found this Creating a Word Doc in C#.NET , but that is

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.