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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T13:02:48+00:00 2026-05-11T13:02:48+00:00

How can I model roles views restfully? Lets say I have a resource that

  • 0

How can I model roles views restfully?

Lets say I have a resource that can be viewed by a buyer or a seller (some content is shared between them on the resource, and some is unique to each one of them)

Should i make them a seperate resource: /resource/1/buyer, /resource/1/seller

or should i pass a format: /resource/1?viewer=seller

  • 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-11T13:02:48+00:00Added an answer on May 11, 2026 at 1:02 pm

    I wouldn’t put it anywhere. Instead, I’d have the same URL display the applicable parts of the resource based on the authenticated user.

    User’s roles are already decided upon when authenticating, makes no sense to require duplicating the data in the query. Imagine you have a complex user permission system. Would you then have the user duplicate their whole ACL in the URL? :/ This way the user doesn’t even have to be aware of it’s roles.

    If the views are fundamentally different (e.g. don’t share any fields at all or fields have different semantics), then I’d create two resources (/auction/1/buyer-info, /auction/1/seller-info). But this likely isn’t the case here.

    If there actually are multiple views of the same resource between which the user can choose, then I’d put the view in the query parameter (?view=simple), since it doesn’t pertain to the resource itself, but actually is the ‘parameter of the query’. But keep in mind that the query parameter here is ‘view’, not ‘viewer’ (like in your example), which IMO is an important difference.

    By following this three approaches, you can cache the resource and then strip the relevant data from it based on a) the current user and b) the view query parameter.

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

Sidebar

Related Questions

I see that EF can update a model based on an existing database schema.
I'm used to the Java model where you can have one public class per
Using the WCF web programming model one can specify an operation contract like so:
Given a model's instance object, how can I get the database table's name? I
I am trying to design an object model (for C#), and can't work out
Can I have a custom service providing the storage of the models I use
The documentation of ReaderWriterLockSlim.EnterUpgradeableReadLock says: A thread in upgradeable mode can downgrade to read
Does anybody know how I can close all modal dialogs created by Dojo ?
On Windows, how can my user-mode program get the driver version number(s) for the
How can I determine if my displays are in Clone Mode without using either

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.