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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T09:35:23+00:00 2026-06-02T09:35:23+00:00

I’m currently developing a little Python website using Pyramid. But I don’t know how

  • 0

I’m currently developing a little Python website using Pyramid.
But I don’t know how to design the permission system.
The System should be very flexible: I have to establish connections between many different tables.
Instead of writing one permission table for every variant i thought to just create one table – I call it PermissionCollection:

PermissionCollection:

  • permissionCollectionId – PrimaryKey
  • onType = ENUM(“USER”,”TEACHER”,”GROUP”,”COURSE”…)
  • onId = Integer

and the Permission table:

  • permissionId – PrimaryKey
  • key
  • value
  • permissionCollectionId – ForeignKey

I’ll define standard PermissionCollections for every possible relationship hard-coded in sources and if a user,course,teacher… has special rights i’ll create a new PermissionCollection and add the permission to it.

I’m very new to web programming, and don’t know if this approach is useful. Or if something like this even exists. I think the Pyramid ACL isn’t the right tool for this task, is it?

  • 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-02T09:35:24+00:00Added an answer on June 2, 2026 at 9:35 am

    Not sure if you read about it already but pyramid does come with a really nice permission system. Authorization with ACL.

    How to handle it, it really only depend of you…
    You could have a ACL table

    (object_id, allow/deny, who?(group, userid), permission, order)

    • object_id is a unique id to a record in your database
    • allow/deny is what this ACE is supposed to do…allow or deny access
    • who? is either a group, username or whatever you want for example system.everyone is everyone
    • permission is the permission parameter in view_config
    • order is one important thing order does matter

    For example

    __acl__ = [
    (Deny, Everyone, 'view'),
    (Allow, 'group:admin', 'view')
    ]
    

    This sample will always deny view even for admin… As soon as pyramid find something that tells you if you can see or not see a record it automatically stop searching

    __acl__ = [
    (Allow, 'group:admin', 'view'),
    (Deny, Everyone, 'view')
    ]
    

    This will allow view for every admin but not for anyone else. That is why you have to remember the order of your ACEs.

    The fun part is here actually. This is all good. You have acl mapped to a record in your data. When you load for example a page… You will have to load the acl and set them in your object.

    myobject.__acl__ = load_acls(myobject) 
    

    If you have a data tree. You can even not set acls.

    For example you have a site that looks like that

    root
      \--pages with acl
          +---- page1  without acl
          \---- page2  with acl
    

    When you will access page1, it will check for acl if it can’t find it, it will check for parent if parent has an acl, it will check permission for it, if it doesn’t it will check for its parent until you reach root. If it can’t find the permission, im not so sure what happens.. I guess it will either give you a forbidden error or predicate error. That it can’t find the proper view.

    That said, in order to make that work you have to make location aware object that knows their parents.

    But why would you want to do all that?

    You can have acl for any object and have really fine grained control on who can watch or not every object in your database. You can also put acl directly in your class object without database.

    as long as your acl is in the attribute acl pyramid will be able to do something with it. It’s not really important how you got it.

    Check this out

    http://pyramid.readthedocs.org/en/1.3-branch/tutorials/wiki/authorization.html

    • 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
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
I used javascript for loading a picture on my website depending on which small
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I want use html5's new tag to play a wav file (currently only supported
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have a French site that I want to parse, but am running into
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and

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.