|
Boolean
|
install(self)
Installs (or upgrades) database tables. |
|
|
|
Boolean
|
uninstall(self)
Drops all tables from the database. |
|
|
|
Boolean
|
clear_database(self)
Drops the content of any database table used by this library. |
|
|
|
Boolean
|
add_action(self,
actions)
Inserts the given action into the database. |
|
|
|
Boolean
|
save_action(self,
actions)
Updates the given actions in the database. |
|
|
|
int
|
delete_action(self,
actions)
Convenience wrapper around delete_action_from_match(). |
|
|
|
int
|
|
|
Boolean
|
add_resource(self,
parent_id,
resources)
Inserts the given resources into the database, under the parent
with the given id. |
|
|
|
Boolean
|
save_resource(self,
resources)
Updates the given resources in the database. |
|
|
|
int
|
delete_resource(self,
resources)
Convenience wrapper around delete_resource_from_match(). |
|
|
|
int
|
|
|
Boolean
|
|
|
Boolean
|
delete_permission(self,
actor,
action,
resource)
Convenience wrapper around delete_permission_from_id(). |
|
|
|
Boolean
|
set_permission_from_id(self,
actor_list,
action_list,
resource_list,
permit)
Defines whether or not the given actors may perform the given
actions on the given resources. |
|
|
|
Boolean
|
set_permission(self,
actor,
action,
resource,
permit)
Convenience wrapper around set_permission_from_id(). |
|
|
|
Boolean
|
grant_from_id(self,
actor_list,
action_list,
resource_list)
Convenience wrapper around set_permission_from_id(). |
|
|
|
Boolean
|
grant(self,
actor,
action,
resource)
Convenience wrapper around set_permission(). |
|
|
|
Boolean
|
deny_from_id(self,
actor_list,
action_list,
resource_list)
Convenience wrapper around set_permission_from_id(). |
|
|
|
Boolean
|
deny(self,
actor,
action,
resource)
Convenience wrapper around set_permission(). |
|
|
|
Inherited from object:
__delattr__,
__getattribute__,
__hash__,
__new__,
__reduce__,
__reduce_ex__,
__repr__,
__setattr__,
__str__
|
|
DB
|
__init__(self,
db)
Instantiates a new DBReader. |
|
|
|
|
debug(self,
debug=True)
Enable/disable debugging. |
|
|
|
Action
|
get_action(self,
**kwargs)
Like get_actions(), but |
|
|
|
list[Action]
|
get_actions(self,
offset=0,
limit=0,
**kwargs)
Returns all actions that match the given criteria. |
|
|
|
datetime.datetime
|
get_last_permission_change(self,
**kwargs)
Returns the time of the last permission change that affected any
resource that matches the given argument. |
|
|
|
list[Acl]
|
|
|
list[Acl]
|
|
|
list[Acl]
|
|
|
Resource
|
|
|
list[Resource]
|
get_resource_children(self,
parent_id,
offset=0,
limit=0,
**kwargs)
Returns the list of children of the given parent that match the
given criteria. |
|
|
|
list[Resource]
|
get_resource_parents(self,
child_ids,
offset=0,
limit=0,
**kwargs)
Returns the list of parents of the given child that also match the
given criteria. |
|
|
|
ResourcePath
|
get_resource_path_from_id(self,
id)
Returns an object representing the "path" of an object;
that is, a list of ancestors, where the first item is the root of the
path and the last item is the one with the given id. |
|
|
|
list[Resource]
|
get_resources(self,
offset=0,
limit=0,
**kwargs)
Returns a list of resources that match the given criteria. |
|
|
|
string
|
|
|
boolean
|
has_permission(self,
actor,
action,
resource)
Convenience wrapper around has_permission_from_id(). |
|
|
|
boolean
|
has_permission_from_id(self,
actor_id,
action_id,
resource_id)
Check whether the actor with the given id has the permission to
perform the action with the given id on the resource with the given
id. |
|
|
|
boolean
|
has_resource(self,
**kwargs)
Like get_resource(), but returns True if at least one result was
found, False otherwise. |
|
|
|
boolean
|
is_registered(self,
objtype)
Checks whether the given class is already registered. |
|
|
|
|
register_type(self,
objtypes)
Before using any other methods you need to let Spiff Guard know
what types (classes) you are using. |
|
|
|
|
set_table_prefix(self,
prefix)
Define a string that is prefixed to all table names in the
database. |
|
|