Add admin commands for database operations
Features: - Add admin command group for database operations - admin list-users: List all users from SQLite/PostgreSQL/MySQL - admin user-notes: List notes for specific user - Add CodiMDDatabase class for direct DB access
This commit is contained in:
@@ -113,3 +113,20 @@ class UserManager:
|
||||
raise Exception(f"Failed to get avatar: {response.status_code}")
|
||||
|
||||
return response.content
|
||||
|
||||
def list_all_users(self) -> list:
|
||||
"""List all users (admin only).
|
||||
|
||||
This requires direct database access as CodiMD doesn't expose
|
||||
a user list API. You'll need to provide database configuration.
|
||||
"""
|
||||
# Since CodiMD doesn't have a built-in user list API,
|
||||
# we return a note explaining this limitation
|
||||
raise NotImplementedError(
|
||||
"CodiMD doesn't have a built-in API to list all users. "
|
||||
"This feature requires direct database access. "
|
||||
"You can query the database directly:\n"
|
||||
" PostgreSQL: SELECT id, email, profile FROM Users;\n"
|
||||
" MySQL: SELECT id, email, profile FROM Users;\n"
|
||||
" SQLite: SELECT id, email, profile FROM Users;"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user