def has_object_permission(checker_name, user, obj):
if user and user.is_superuser:<EOL><INDENT>return True<EOL><DEDENT>checker = PermissionsManager.retrieve_checker(checker_name)<EOL>user_roles = get_user_roles(user)<EOL>if not user_roles:<EOL><INDENT>user_roles = [None]<EOL><DEDENT>return any([checker(user_role, user, obj) for user_role in user_roles])<EOL>
Check if a user has permission to perform an action on an object.