File tree Expand file tree Collapse file tree
packages/frontend/src/pages Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -208,6 +208,7 @@ type ChannelManageStatus = GetMkSelectValueTypesFromDef<typeof channelManageStat
208208const tab = ref (' overview' );
209209
210210const channel = ref <Misskey .entities .Channel | null >(null );
211+ const canManageChannelEvents = computed (() => hasChannelEventManagePermission (channel .value ));
211212const favorited = ref (false );
212213const searchQuery = ref (' ' );
213214const searchPaginator = shallowRef ();
@@ -365,6 +366,13 @@ async function search() {
365366 searchKey .value = query ;
366367}
367368
369+ function hasChannelEventManagePermission(targetChannel : Misskey .entities .Channel | null ): boolean {
370+ if (! $i || targetChannel == null ) return false ;
371+ if (iAmModerator ) return true ;
372+
373+ return $i .id === targetChannel .userId || targetChannel .collaboratorIds ?.includes ($i .id ) === true ;
374+ }
375+
368376// Channel events
369377const selectedEventDate = ref <string | null >(null );
370378const channelEvents = ref <Misskey .entities .Event []>([]);
You can’t perform that action at this time.
0 commit comments