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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T17:17:38+00:00 2026-05-30T17:17:38+00:00

How do you prevent people from reaching certain routes, for example, edit and delete,

  • 0

How do you prevent people from reaching certain routes, for example, edit and delete, if they are not registered, or not authorized?

In other words, how can I make so that the router rejects or redirects calls like:

http://appname.com/#/photo/1/edit

without duplicating the validation logic?

What I see as a very buzzing problem is the following: if I go to the aforementioned url, my router method won’t bother to fetch info from the server if I have the photo model already (because this is what stateful apps should do, right ). However, now there is completely no way to tell if the current user is the owner of the photo (to be able to edit), unless the router method checks explicitly if their IDs match … which is already duplication of the validation logic (because the server always makes a validation).

Dilemmas like this are simply ruining my day

  • 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-05-30T17:17:39+00:00Added an answer on May 30, 2026 at 5:17 pm

    Your models shouldn’t be doing any authentication logic. If you have the logic in your server-side code, what’s the problem? Your server should return unauthorized (401 or something similar), and then your model can respond appropriately (e.g., printing an error message to the user).

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

Sidebar

Related Questions

I want a permission that will prevent people from logging in. (So, all users
What are the big limitations with VB.Net that prevent people from wanting to use
Is there any way to hide or encrypt JavaScript code to prevent people from
So I want to prevent people from copying files out of my app while
I was just wondering if there is a way to prevent people from copying
Is it possible to prevent someone other than those allowed from tampering with the
I'm having trouble figuring out how to prevent people from editing the amount in
I know it's impossible to prevent people from stealing our data, but I have
How do I prevent people from entering their email address in the description field
As I understand it software being open source does not prevent you from selling

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.