def available_perm_status(user):
roles = get_user_roles(user)<EOL>permission_hash = {}<EOL>for role in roles:<EOL><INDENT>permission_names = role.permission_names_list()<EOL>for permission_name in permission_names:<EOL><INDENT>permission_hash[permission_name] = get_permission(<EOL>permission_name) in user.user_permissions.all()<EOL><DEDENT><DEDENT>return permission_hash<EOL>
Get a boolean map of the permissions available to a user
based on that user's roles.