Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.2 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Libraries

    simple-rbac 0.1.1

    Download button

    No screenshots available
    Downloads: 125  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    TonySeek | More programs
    MIT/X Consortium Lic... / FREE
    June 12th, 2012, 20:15 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    simple-rbac description

    A simple role based access control utility

    simple-rbac is a simple role based access control utility in Python.

    Quick Start

    1. Install Simple RBAC

    pip install simple-rbac

    2. Create a Access Control List

    import rbac.acl

    acl = rbac.acl.Registry()


    3. Register Roles and Resources

    acl.add_role("member")
    acl.add_role("student", ["member"])
    acl.add_role("teacher", ["member"])
    acl.add_role("junior-student", ["student"])

    acl.add_resource("course")
    acl.add_resource("senior-course", ["course"])


    4. Add Rules

    acl.allow("member", "view", "course")
    acl.allow("student", "learn", "course")
    acl.allow("teacher", "teach", "course")
    acl.deny("junior-student", "learn", "senior-course")


    5. Use It to Check Permission

    if acl.is_allowed("student", "view", "course"):
     print("Students chould view courses.")
    else:
     print("Students chould not view courses.")

    if acl.is_allowed("junior-student", "learn", "senior-course"):
     print("Junior students chould learn senior courses.")
    else:
     print("Junior students chould not learn senior courses.")



    Product's homepage

    Requirements:

    · Python

      


    TAGS:

    access control | Python library | Python | access | control

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM