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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T19:51:37+00:00 2026-05-16T19:51:37+00:00

I’m trying to store rules for web requests in a JSON object and am

  • 0

I’m trying to store rules for web requests in a JSON object and am having trouble thinking of a good structure. Here are some examples of my rules:

Possible Conditions

the user must be logged in
the user must belong to an account of type [____]
the user must belong to an account named [___]
the user must have a username [___]
the user must have the account role [___]
the current time must be between [___] and [___]
the variable [___] must be set to [___]

Possible Success Actions

allow access to the requested view
redirect to download a specific file

Possible Failure Actions

redirect to a certain view to display reasons why access was denied
redirect to a purchase page
redirect to a login page with a notice explaining why access was denied

I need to store multiple rules in a single object. I also need to be able to store boolean relationships like this:

(rule1 && rule2) || rule3

Object structure normally comes easy to me, but I’m struggling putting this together. Here’s an example of a requirement the JSON object should be able to store:

A user can access the control panel if they are logged in and belong to an account named “Owners”. If the user has the account role “Employee” then they can only login during Monday-Friday, not weekends. If the user has the name “root” they can login regardless of any other rule. If none of the rules succeed, then redirect the user to a page telling them specifically why they are unable to get to the control panel. E.g., “It’s the weekend and you are only allowed to login Monday-Friday.”

  • 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-16T19:51:40+00:00Added an answer on May 16, 2026 at 7:51 pm

    Check out Amazon S3 Bucket Policies fits the bill. It’s already in JSON. Try extending the Conditions with your own and extend the Effect actions to include a message.

    http://docs.amazonwebservices.com/AmazonS3/latest/dev/index.html?AccessPolicyLanguage.html

    I’d say try looking for an open source Amazon bucket policy creator tool that you can extend but I’m not finding anything with a simple google search.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am trying to render a haml file in a javascript response like so:

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.