source: examples/python_tests/access_rt2/README @ f824a9e

mei_rt2mei_rt2_fix_1
Last change on this file since f824a9e was f824a9e, checked in by Mei <mei@…>, 12 years ago

1) add more doc to python_tests

  • Property mode set to 100755
File size: 1.8 KB
Line 
1#####################################################################
2# This example demonstrates using an oset (object set) to control access
3# to files based on the attributes of the principals.  The script creates
4# three principals Alpha, Bob and Joe and sets out the access policy.
5#
6# files are named by URNs and are not principals.
7#
8# A principal's access rights are controlled by the Alpha principal.  If a
9# principal has the role role::acess(string:'Read', urn:filename) that
10# principal can Read filename. 
11# The policy names 2 teams, proj1 and proj1.  A principal is on proj1 if it
12# has the role team(string:'proj1') defined by Alpha (written
13# [keyid:Alpha].role:team(string:'proj1')).  Each project has an associated set
14# of files, defined by object sets.  A file is in proj1's documents if it is in
15# the oset of documents('proj1') defined by Alpha, written
16# [keyid:Alpha].oset:documents(string:'proj1'))
17#
18# The example below lays out the policy that members of a given project can
19# Read the documents of that project in Credential 1 and adds file://fileA to
20# the document set for proj1 in Credential 2 - note that no principal is
21# required for fileA.  Credentials 3 & 4 add Bob to proj1 and Joe to proj2.
22#
23# The attached query.py file runs 3 queries.  First it confirms that Bob can Read
24# fileA, then it confirms that Joe cannot.  Finally it confirms that Joe is in
25# proj2.
26
27# access_rt2
28
29# Credential 1
30#[keyid:alpha].role:access([string:'Read'],
31#                    [urn:?F[keyid:alpha].oset:documents([string:?P])])
32#                                     <- [keyid:alpha].role:team([string:?P])
33# Credential 2
34#[keyid:alpha].oset:documents([string:'proj1'])<-[urn:'file//fileA']
35# Credential 3
36# [keyid:alpha].role:team([string:'proj1'])<-[keyid:Bob]
37# Credential 4
38# [keyid:alpha].role:team([string:'proj2'])<-[keyid:Joe]
Note: See TracBrowser for help on using the repository browser.