feat: auth supports forbidden permissions (#329)

This commit is contained in:
sigoden
2023-12-23 18:36:46 +08:00
committed by GitHub
parent 006e03ed30
commit af347f9cf0
4 changed files with 88 additions and 63 deletions

View File

@@ -345,7 +345,7 @@ impl Server {
method => match method.as_str() {
"PROPFIND" => {
if is_dir {
let access_paths = if access_paths.perm().indexonly() {
let access_paths = if access_paths.perm().inherit() {
// see https://github.com/sigoden/dufs/issues/229
AccessPaths::new(AccessPerm::ReadOnly)
} else {
@@ -1183,7 +1183,7 @@ impl Server {
access_paths: AccessPaths,
) -> Result<Vec<PathItem>> {
let mut paths: Vec<PathItem> = vec![];
if access_paths.perm().indexonly() {
if access_paths.perm().inherit() {
for name in access_paths.child_names() {
let entry_path = entry_path.join(name);
self.add_pathitem(&mut paths, base_path, &entry_path).await;