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';
55
66import { KEY_CAN_EDIT , useDocCanEdit } from '../api/useDocCanEdit' ;
77import { useProviderStore } from '../stores' ;
8- import { Doc , LinkReach } from '../types' ;
8+ import { Doc , LinkReach , LinkRole } from '../types' ;
99
1010export const useIsCollaborativeEditable = ( doc : Doc ) => {
1111 const { isConnected } = useProviderStore ( ) ;
1212 const { data : conf } = useConfig ( ) ;
1313
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 ;
1722 const isUserReader = ! doc . abilities . partial_update ;
1823 const isShared = docIsPublic || docIsAuth || docHasMember ;
1924 const { isOffline } = useIsOffline ( ) ;
You can’t perform that action at this time.
0 commit comments