This commit is contained in:
2025-08-02 11:38:02 +02:00
parent 4e2971c942
commit a53f4be3e5
7 changed files with 61 additions and 20 deletions

View File

@ -31,6 +31,7 @@ services:
- ./misc:/app/misc:delegated
- ./public/lib:/app/public/lib:delegated
- ./.env.local:/app/.env.local
- ./vendor:/app/vendor:delegated
adminer:
image: adminer

View File

@ -3,12 +3,6 @@
"license": "proprietary",
"minimum-stability": "stable",
"prefer-stable": true,
"repositories": [
{
"type": "vcs",
"url": "https://github.com/afornerot/bNine-FilesBundle"
}
],
"require": {
"php": ">=8.2",
"ext-ctype": "*",

46
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "5aaa9ef4d4fe029a60e73e3590fc5109",
"content-hash": "c51420403fb7554473719338f24959d9",
"packages": [
{
"name": "apereo/phpcas",
@ -79,40 +79,64 @@
},
{
"name": "bnine/filesbundle",
"version": "v1.0.39",
"version": "v1.0.4",
"source": {
"type": "git",
"url": "https://github.com/afornerot/bNine-FilesBundle.git",
"reference": "9fab2530ec5528ce449351886ca6c503acee4b2c"
"reference": "7854b91c128e51c24c8f3d3c9864909cfdf88216"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/afornerot/bNine-FilesBundle/zipball/9fab2530ec5528ce449351886ca6c503acee4b2c",
"reference": "9fab2530ec5528ce449351886ca6c503acee4b2c",
"url": "https://api.github.com/repos/afornerot/bNine-FilesBundle/zipball/7854b91c128e51c24c8f3d3c9864909cfdf88216",
"reference": "7854b91c128e51c24c8f3d3c9864909cfdf88216",
"shasum": ""
},
"require": {
"php": ">=8.1",
"symfony/framework-bundle": "^6.0 || ^7.0"
"php": "^8.1",
"symfony/framework-bundle": "^7.1"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.85"
},
"suggest": {
"oneup/uploader-bundle": "^4.0"
},
"type": "symfony-bundle",
"extra": {
"branch-alias": {
"dev-main": "1.0-dev"
}
},
"autoload": {
"psr-4": {
"Bnine\\FilesBundle\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "Symfony bundle for file-browser",
"authors": [
{
"name": "afornerot",
"email": "arno.nanor@gmail.com"
}
],
"description": "Symfony bundle for entity-based file browser and management.",
"keywords": [
"bundle",
"directory",
"entity",
"file-browser",
"files",
"symfony",
"upload"
],
"support": {
"source": "https://github.com/afornerot/bNine-FilesBundle/tree/v1.0.39",
"issues": "https://github.com/afornerot/bNine-FilesBundle/issues"
"issues": "https://github.com/afornerot/bNine-FilesBundle/issues",
"source": "https://github.com/afornerot/bNine-FilesBundle/tree/v1.0.4"
},
"time": "2025-08-01T18:40:55+00:00"
"time": "2025-08-02T09:25:01+00:00"
},
{
"name": "brick/math",

View File

@ -4,5 +4,5 @@ oneup_uploader:
frontend: dropzone
logo:
frontend: dropzone
file:
bninefile:
frontend: dropzone

View File

@ -5,5 +5,5 @@ controllers:
type: attribute
bninefilesbundle:
resource: '../vendor/bnine/filesbundle/config/routes.yaml'
resource: '@BnineFilesBundle/config/routes.yaml'
prefix: '/bninefiles'

View File

@ -47,4 +47,26 @@ class FileVoter extends AbstractFileVoter
return false;
}
protected function canDelete(string $domain, $id, TokenInterface $token): bool
{
$user = $token->getUser();
if (!$user instanceof User) {
return false;
}
if ($user->hasRole('ROLE_ADMIN')) {
return true;
}
switch ($domain) {
case 'project':
$project = $this->projectRepository->find($id);
if ($project && $project->getUsers()->contains($user)) {
return true;
}
break;
}
return false;
}
}

View File

@ -3,7 +3,7 @@
"version": "v1.0.1"
},
"bnine/filesbundle": {
"version": "v1.0.27"
"version": "v1.0.1"
},
"doctrine/deprecations": {
"version": "1.1",