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 - ./misc:/app/misc:delegated
- ./public/lib:/app/public/lib:delegated - ./public/lib:/app/public/lib:delegated
- ./.env.local:/app/.env.local - ./.env.local:/app/.env.local
- ./vendor:/app/vendor:delegated
adminer: adminer:
image: adminer image: adminer

View File

@ -3,12 +3,6 @@
"license": "proprietary", "license": "proprietary",
"minimum-stability": "stable", "minimum-stability": "stable",
"prefer-stable": true, "prefer-stable": true,
"repositories": [
{
"type": "vcs",
"url": "https://github.com/afornerot/bNine-FilesBundle"
}
],
"require": { "require": {
"php": ">=8.2", "php": ">=8.2",
"ext-ctype": "*", "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", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "5aaa9ef4d4fe029a60e73e3590fc5109", "content-hash": "c51420403fb7554473719338f24959d9",
"packages": [ "packages": [
{ {
"name": "apereo/phpcas", "name": "apereo/phpcas",
@ -79,40 +79,64 @@
}, },
{ {
"name": "bnine/filesbundle", "name": "bnine/filesbundle",
"version": "v1.0.39", "version": "v1.0.4",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/afornerot/bNine-FilesBundle.git", "url": "https://github.com/afornerot/bNine-FilesBundle.git",
"reference": "9fab2530ec5528ce449351886ca6c503acee4b2c" "reference": "7854b91c128e51c24c8f3d3c9864909cfdf88216"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/afornerot/bNine-FilesBundle/zipball/9fab2530ec5528ce449351886ca6c503acee4b2c", "url": "https://api.github.com/repos/afornerot/bNine-FilesBundle/zipball/7854b91c128e51c24c8f3d3c9864909cfdf88216",
"reference": "9fab2530ec5528ce449351886ca6c503acee4b2c", "reference": "7854b91c128e51c24c8f3d3c9864909cfdf88216",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=8.1", "php": "^8.1",
"symfony/framework-bundle": "^6.0 || ^7.0" "symfony/framework-bundle": "^7.1"
}, },
"require-dev": { "require-dev": {
"friendsofphp/php-cs-fixer": "^3.85" "friendsofphp/php-cs-fixer": "^3.85"
}, },
"suggest": {
"oneup/uploader-bundle": "^4.0"
},
"type": "symfony-bundle", "type": "symfony-bundle",
"extra": {
"branch-alias": {
"dev-main": "1.0-dev"
}
},
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"Bnine\\FilesBundle\\": "src/" "Bnine\\FilesBundle\\": "src/"
} }
}, },
"notification-url": "https://packagist.org/downloads/",
"license": [ "license": [
"MIT" "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": { "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", "name": "brick/math",

View File

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

View File

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

View File

@ -47,4 +47,26 @@ class FileVoter extends AbstractFileVoter
return false; 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" "version": "v1.0.1"
}, },
"bnine/filesbundle": { "bnine/filesbundle": {
"version": "v1.0.27" "version": "v1.0.1"
}, },
"doctrine/deprecations": { "doctrine/deprecations": {
"version": "1.1", "version": "1.1",