1
我希望能够允许某些前端用户访问受保护文件。前端用户正在使用https://github.com/rainlab/user-plugin允许前端用户访问受保护文件
目前我只能看到有2个选项。公众和受保护。任何人都可以查看公共安全性,只有后端用户才能使用受保护的公共安全。
有没有什么办法可以在插件或解决方案中使用routes.php验证某个目录是否使用受保护文件的用户身份验证?
这是我的route.php的一个例子,但不知道如何扩展到auth。
$cmsStorage = AppConfig::get('cms.storage.uploads.path', '/storage/app/uploads');
$uploadsPath = $cmsStorage. '/privatefiles/{dir1}/{dir2}/{dir3}/{disk_name}';
Routes::get($uploadsPath, function ($dir1, $dir2, $dir3) {
// some login in here to return file
});