Welcome Guest to Computer System Consulting!

Documentation Access and Display Fixes

Overview

This update addresses several issues with the documentation system, focusing on role-based access control, path resolution, and template rendering. These improvements ensure that all users can access the documentation they are authorized to view, with proper formatting and navigation.

Date: October 15, 2025
Type: Bug Fix
Priority: High

Issues Fixed

Role-Based Access Control

Path Resolution

Template Rendering

Technical Changes

Controller Updates

# Enhanced role-based access control logic
if (lc($role) eq lc($user_role)) {
    $has_role = 1;
    $self->logging->log_with_details($c, 'debug', __FILE__, __LINE__, 'view',
        "Role match: user role $user_role matches required role $role for page $page");
    last;
}
# Special case for normal role - any authenticated user can access normal content
elsif (lc($role) eq 'normal' && $user_role) {
    $has_role = 1;
    $self->logging->log_with_details($c, 'debug', __FILE__, __LINE__, 'view',
        "Normal role access granted to page $page for user with role $user_role");
    last;
}
        

Path Resolution Logic

# Check if there's a default path defined in the documentation_config.json file
if ($config->{default_paths} && $config->{default_paths}{$page}) {
    $default_path = $config->{default_paths}{$page};
    $self->logging->log_with_details($c, 'info', __FILE__, __LINE__, 'view',
        "Found default path for $page: $default_path");
}

# If a default path is defined, try to use it
if ($default_path) {
    my $full_default_path = $c->path_to('root', $default_path);
    
    if (-e $full_default_path) {
        $self->logging->log_with_details($c, 'info', __FILE__, __LINE__, 'view',
            "Using default path for $page: $default_path");
            
        # Determine file type based on extension and render appropriately
        # ...
    }
}
        

User Impact

These changes improve the documentation system in the following ways:

Related Documentation