File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,9 @@ import { OrderBy } from "~/store"
1313import { Col , cols , ListItem } from "./ListItem"
1414import { ItemCheckbox , useSelectWithMouse } from "./helper"
1515import { bus } from "~/utils"
16+ import { UserMethods , UserPermissions } from "~/types"
17+ import { me } from "~/store"
18+ import { getCurrentPath } from "~/store/obj"
1619
1720export const ListTitle = ( props : {
1821 sortCallback : ( orderBy : OrderBy , reverse ?: boolean ) => void
@@ -78,6 +81,12 @@ export const ListTitle = (props: {
7881
7982const ListLayout = ( ) => {
8083 const onDragOver = ( e : DragEvent ) => {
84+ // 拖拽上传做权限检查限制
85+ const writeIndex = UserPermissions . findIndex ( ( item ) => item === "write" )
86+ if ( ! UserMethods . can ( me ( ) , writeIndex , getCurrentPath ( ) ) ) {
87+ return
88+ }
89+
8190 const items = Array . from ( e . dataTransfer ?. items ?? [ ] )
8291 for ( let i = 0 ; i < items . length ; i ++ ) {
8392 const item = items [ i ]
You can’t perform that action at this time.
0 commit comments