mirror of
https://github.com/truewhile/MeBox.git
synced 2026-10-02 04:16:38 +08:00
Hide scrape and library admin controls from non-admin users.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -53,8 +53,9 @@ export const usePermissionStore = create<PermissionState>((set, get) => ({
|
||||
|
||||
hasPermission: (key: string) => {
|
||||
const state = get()
|
||||
// Super user (admin or plus) has all permissions
|
||||
if (state.isSuper) {
|
||||
// Only admins implicitly have every capability in the UI.
|
||||
// Plus / is_super must not reveal scrape/organize/delete controls.
|
||||
if (state.role === 'admin') {
|
||||
return true
|
||||
}
|
||||
return (state.permissions ?? {})[key] === true
|
||||
|
||||
Reference in New Issue
Block a user