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

  • Home
  • SEARCH
  • 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 83777
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T21:49:38+00:00 2026-05-10T21:49:38+00:00

I am doing my best to design my web app with good separation between

  • 0

I am doing my best to design my web app with good separation between the layers. I am using the repository pattern and as such have a SQLObjectRepository which is called by my ObjectService which is called by my Web front end.

In my object model, the user is associated with one or more regions which should filter the objects they should have access to. My question is, when I am querying for objects, do I put the code in the service to set the permissions on the objects, or should that code be in the repository? If the user is a member of 2 regions, should I pass the user as a parameter to the service, or should I pass the user’s regions to the service?

  • 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. 2026-05-10T21:49:38+00:00Added an answer on May 10, 2026 at 9:49 pm

    I would:

    • Write the security check in such a way that it can be applied in any place you like. This way you can refactor as requirements change.

    • If the security check really will always apply, place it in the repository layer (or better, in an aspect if your language supports it) so that multiple services will all share common security if they use the same repository. Otherwise place it in the service (or an aspect acting on the service).

    • pass the entire user object to the security checking mechanism:

      • if the security check later becomes more complex (depends on other properties of the user) the API won’t change;
      • it makes more semantic sense – you’re checking the user has permission to do something, not that a list of countries does.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 256k
  • Answers 257k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer n is the argument of the anonymous function returned by… May 13, 2026 at 10:39 am
  • Editorial Team
    Editorial Team added an answer This error usually arises because a relationship is set improperly… May 13, 2026 at 10:39 am
  • Editorial Team
    Editorial Team added an answer Check which storage engine the table is using: SHOW TABLE… May 13, 2026 at 10:39 am

Related Questions

I am making a webapp right now and I am trying to get my
I am trying to design an Picture Upload feature into a web site. I
The reason I am asking this question is because I have landed my first
I am in the process of developing a web application that consists visually of

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.