pcyi_db — PyCI DB Module

change_group_permission(group, plugin, permission, id=None)
Adds or modifies a group’s permissions to a given plugin. permission should either be ‘r’ or ‘rw’.
change_user_permission(user, plugin, permission, id=None)
Modifies a user’s permissions to a given plugin. ‘permission’ should either be ‘r’ or ‘rw’.
check_group_permission(group=None, plugin=None, orderby=None, sortorder=None)
Returns a group’s permissions for a given plugin (‘r’ or ‘rw’). If no group or plugin are supplied, return a list of all group permissions. If only a group is supplied, return a list of all its permissions. If only a plugin is supplied, return a list of all related group permissions.
check_user_permission(user=None, plugin=None, orderby=None, sortorder=None)
Returns a user’s permissions for a given plugin (‘r’ or ‘rw’). If no user or plugin are supplied, return a list of all user permissions. If only a user is supplied, return a list of all their permissions. If only a plugin is supplied, return a list of all related user permissions.
cleanup_permissions(user)
If a user has been granted ‘all’ permissions they only need one entry in the permissions table. This function gets rid of all the extraneous entries and just leaves one ‘all’ entry
connect_db(db)
Connect to the sqlite3 database path, ‘db’ and return it as an sqlite3 object
delete_group_permission_by_id(key)
Deletes the row where id=’key’ in ‘db’
delete_user_permission_by_id(key)
Deletes the row where id=’key’ in ‘db’
disconnect_db(db)
close() the given sqlite3 object