alist/internal/db
千石 e1800f18e4
feat: Check usage before deleting storage (#9322)
* feat(storage): Added role and user path checking functionality

- Added `GetAllRoles` function to retrieve all roles
- Added `GetAllUsers` function to retrieve all users
- Added `firstPathSegment` function to extract the first segment of a path
- Checks whether a storage object is used by a role or user, and returns relevant information for unusing it

* fix(storage): Fixed a potential null value issue with not checking firstMount.

- Added a check to see if `firstMount` is null to prevent logic errors.
- Adjusted the loading logic of `GetAllRoles` and `GetAllUsers` to only execute when `firstMount` is non-null.
- Fixed the `usedBy` check logic to ensure that an error message is returned under the correct conditions.
- Optimized code structure to reduce unnecessary execution paths.
2025-09-12 17:56:23 +08:00
..
db.go feat: implement session management (#9286) 2025-08-25 19:46:38 +08:00
label.go feat: enhance permission control and label management (#9215) 2025-07-26 09:51:59 +08:00
label_file_binding.go feat: add tag backup and fix bugs (#9265) 2025-08-15 23:09:00 +08:00
meta.go fix: out of order when database is not sqlite3 (#6560) 2024-08-03 13:11:09 +08:00
obj_file.go feat: enhance permission control and label management (#9215) 2025-07-26 09:51:59 +08:00
role.go feat: Check usage before deleting storage (#9322) 2025-09-12 17:56:23 +08:00
searchnode.go feat(search): paging and scope (close #4381 in #4930) 2023-08-06 15:13:23 +08:00
session.go fix: session invalid issue (#9301) 2025-08-29 21:20:29 +08:00
settingitem.go fix: out of order when database is not sqlite3 (#6560) 2024-08-03 13:11:09 +08:00
sshkey.go feat(sftp-server): public key login (#7668) 2024-12-25 21:15:06 +08:00
storage.go fix: out of order when database is not sqlite3 (#6560) 2024-08-03 13:11:09 +08:00
tasks.go feat: persistant Task (#6925 close #5313) 2024-08-07 12:16:21 +08:00
user.go feat: Check usage before deleting storage (#9322) 2025-09-12 17:56:23 +08:00
util.go fix: out of order when database is not sqlite3 (#6560) 2024-08-03 13:11:09 +08:00