NAME
Koha::QA::FilePermissions - Centralized file permissions checking
SYNOPSIS
use Koha::QA::FilePermissions;
# With a file
my $checker = Koha::QA::FilePermissions->new({file => $file});
# Or with content directly
my $checker = Koha::QA::FilePermissions->new({content => $content});
my $is_valid = $checker->check;
my @errors = $checker->errors;
DESCRIPTION
This module provides centralized file permissions checking.
METHODS
new
my $checker = Koha::QA::FilePermissions->new({file => $file_path});
Creates a new FilePermissions instance.
check
my $is_valid = $checker->check;
Checks if a file has correct executable permissions.
errors
my @errors = $checker->errors;
Returns array of error hashrefs, each with: - error: the error type (missing_x_flag, extra_x_flag)
Rules: - Files in svc/, xt/ and .t files: must have exec flag - .pl and .sh files: must have exec flag - .pm files: must NOT have exec flag
AUTHORS
Jonathan Druart <jonathan.druart@bugs.koha-community.org>
COPYRIGHT
Copyright 2026 Koha Development Team
LICENSE
This file is part of Koha.
Koha is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.