Package s3 :: Module s3anonymize :: Class S3Anonymize
[frames] | no frames]

Class S3Anonymize

source code

     object --+    
              |    
s3rest.S3Method --+
                  |
                 S3Anonymize

REST Method to Anonymize Person Records

Instance Methods
 
apply_method(self, r, **attr)
Entry point for REST API
source code
 
get_target_id(self)
Determine the target table and record ID
source code

Inherited from s3rest.S3Method: __call__, widget

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Methods
 
anonymize(cls, r, table, record_id)
Handle POST (anonymize-request), i.e.
source code
 
cascade(cls, table, record_ids, rules)
Apply cascade of rules to anonymize records
source code
Static Methods
 
permitted(table, record_id)
Check permissions to anonymize the target record
source code
 
apply_field_rules(table, record_ids, rules)
Apply field rules on a set of records in a table
source code

Inherited from s3rest.S3Method: crud_string

Properties

Inherited from object: __class__

Method Details

apply_method(self, r, **attr)

source code 

Entry point for REST API

Parameters:
  • r - the S3Request instance
  • attr - controller parameters
Returns:
output data (JSON)
Overrides: s3rest.S3Method.apply_method

anonymize(cls, r, table, record_id)
Class Method

source code 

Handle POST (anonymize-request), i.e. anonymize the target record

Parameters:
  • r - the S3Request
  • table - the target Table
  • record_id - the target record ID
Returns:
JSON message

get_target_id(self)

source code 

Determine the target table and record ID

Returns:
tuple (table, record_id)

permitted(table, record_id)
Static Method

source code 

Check permissions to anonymize the target record

Parameters:
  • table - the target Table
  • record_id - the target record ID
Returns:
True|False

cascade(cls, table, record_ids, rules)
Class Method

source code 

Apply cascade of rules to anonymize records

Parameters:
  • table - the Table
  • record_ids - a set of record IDs
  • rules - the rules for this Table
Raises:
  • Exception - if the cascade failed due to DB constraints or invalid rules; callers should roll back the transaction if an exception is raised

apply_field_rules(table, record_ids, rules)
Static Method

source code 

Apply field rules on a set of records in a table

Parameters:
  • table - the Table
  • record_ids - the record IDs
  • rules - the rules
Raises:
  • Exception - if the field rules could not be applied due to DB constraints or invalid rules; callers should roll back the transaction if an exception is raised