src/main/java/tracer/util/PermissionComputer.java
/**
     * @param member Calculates base permissions based on the
     *               permissions given to @everyone and member's roles
     * @return long with general permissions
     */
@param member Calculates base permissions based on the
permissions given to @everyone and member's roles
@return long with general permissions
@param member Calculates base permissions based on the permissions given to @everyone and member ' s roles @return long with general permissions
private static long computeBasePermissions(@Nonnull Member member) {
        if (member.isOwner()) return Permission.ALL_PERMISSIONS;
        long everyonePermissions = member.getGuild().getPublicRole().getPermissionsRaw();
        for (Role role : member.getRoles()) {
            everyonePermissions |= role.getPermissionsRaw();
        }
        if ((everyonePermissions & Permission.ADMINISTRATOR.getRawValue()) == Permission.ADMINISTRATOR.getRawValue()) {
            return Permission.ALL_PERMISSIONS;
        }
        return everyonePermissions;
    }
private static long computeBasePermissions ( @ Nonnull Member member ) { if ( member . isOwner ( ) ) return Permission . ALL_PERMISSIONS ; long everyonePermissions = member . getGuild ( ) . getPublicRole ( ) . getPermissionsRaw ( ) ; for ( Role role : member . getRoles ( ) ) { everyonePermissions |= role . getPermissionsRaw ( ) ; } if ( ( everyonePermissions & Permission . ADMINISTRATOR . getRawValue ( ) ) == Permission . ADMINISTRATOR . getRawValue ( ) ) { return Permission . ALL_PERMISSIONS ; } return everyonePermissions ; }
@param member Calculates base permissions based on the
               permissions given to @everyone and member's roles
 @return long with general permissions
@param member Calculates base permissions based on the permissions given to @everyone and member ' s roles @return long with general permissions