File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
src/frontend/apps/impress/src/features/docs/doc-management/hooks Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -5,15 +5,20 @@ import { useIsOffline } from '@/features/service-worker';
5
5
6
6
import { KEY_CAN_EDIT , useDocCanEdit } from '../api/useDocCanEdit' ;
7
7
import { useProviderStore } from '../stores' ;
8
- import { Doc , LinkReach } from '../types' ;
8
+ import { Doc , LinkReach , LinkRole } from '../types' ;
9
9
10
10
export const useIsCollaborativeEditable = ( doc : Doc ) => {
11
11
const { isConnected } = useProviderStore ( ) ;
12
12
const { data : conf } = useConfig ( ) ;
13
13
14
- const docIsPublic = doc . link_reach === LinkReach . PUBLIC ;
15
- const docIsAuth = doc . link_reach === LinkReach . AUTHENTICATED ;
16
- const docHasMember = doc . nb_accesses_direct > 1 ;
14
+ const docIsPublic =
15
+ doc . computed_link_reach === LinkReach . PUBLIC &&
16
+ doc . computed_link_role === LinkRole . EDITOR ;
17
+ const docIsAuth =
18
+ doc . computed_link_reach === LinkReach . AUTHENTICATED &&
19
+ doc . computed_link_role === LinkRole . EDITOR ;
20
+ const docHasMember =
21
+ doc . nb_accesses_direct > 1 || doc . nb_accesses_ancestors > 1 ;
17
22
const isUserReader = ! doc . abilities . partial_update ;
18
23
const isShared = docIsPublic || docIsAuth || docHasMember ;
19
24
const { isOffline } = useIsOffline ( ) ;
You can’t perform that action at this time.
0 commit comments