@@ -12,7 +12,7 @@ import type {
1212 Invite ,
1313 Override ,
1414} from "stoat-api" ;
15- import type { APIRoutes } from "stoat-api/lib/routes " ;
15+ import type { APIRoutes } from "stoat-api" ;
1616import { decodeTime , ulid } from "ulid" ;
1717
1818import { ChannelCollection } from "../collections/index.js" ;
@@ -229,21 +229,21 @@ export class Channel {
229229 /**
230230 * Permissions allowed for users in this group
231231 */
232- get permissions ( ) : number | undefined {
232+ get permissions ( ) : bigint | undefined {
233233 return this . #collection. getUnderlyingObject ( this . id ) . permissions ;
234234 }
235235
236236 /**
237237 * Default permissions for this server channel
238238 */
239- get defaultPermissions ( ) : { a : number ; d : number } | undefined {
239+ get defaultPermissions ( ) : { a : bigint ; d : bigint } | undefined {
240240 return this . #collection. getUnderlyingObject ( this . id ) . defaultPermissions ;
241241 }
242242
243243 /**
244244 * Role permissions for this server channel
245245 */
246- get rolePermissions ( ) : Record < string , { a : number ; d : number } > | undefined {
246+ get rolePermissions ( ) : Record < string , { a : bigint ; d : bigint } > | undefined {
247247 return this . #collection. getUnderlyingObject ( this . id ) . rolePermissions ;
248248 }
249249
@@ -349,16 +349,16 @@ export class Channel {
349349 get potentiallyRestrictedChannel ( ) : string | boolean | undefined {
350350 if ( ! this . serverId ) return false ;
351351 return (
352- bitwiseAndEq ( this . defaultPermissions ?. d ?? 0 , Permission . ViewChannel ) ||
352+ bitwiseAndEq ( this . defaultPermissions ?. d ?? 0n , Permission . ViewChannel ) ||
353353 ! bitwiseAndEq ( this . server ! . defaultPermissions , Permission . ViewChannel ) ||
354354 [ ...( this . server ?. roles . keys ( ) ?? [ ] ) ] . find (
355355 ( role ) =>
356356 bitwiseAndEq (
357- this . rolePermissions ?. [ role ] ?. d ?? 0 ,
357+ this . rolePermissions ?. [ role ] ?. d ?? 0n ,
358358 Permission . ViewChannel ,
359359 ) ||
360360 bitwiseAndEq (
361- this . server ?. roles . get ( role ) ?. permissions . d ?? 0 ,
361+ this . server ?. roles . get ( role ) ?. permissions . d ?? 0n ,
362362 Permission . ViewChannel ,
363363 ) ,
364364 )
@@ -368,7 +368,7 @@ export class Channel {
368368 /**
369369 * Permission the currently authenticated user has against this channel
370370 */
371- get permission ( ) : number {
371+ get permission ( ) : bigint {
372372 return calculatePermission ( this . #collection. client , this ) ;
373373 }
374374
0 commit comments