def has_permission(user, permission_name):
if user and user.is_superuser:<EOL><INDENT>return True<EOL><DEDENT>return permission_name in available_perm_names(user)<EOL>
Check if a user has a given permission.